The simplest way to run arlocal is to use npx, which requires having nodejs and npm installed on your machine.
npx arlocal
Alternatively, you can install it in your project
cd my-project
npm install -D arlocal
npm arlocal
You can configure various parameters like port and persistence by using command-line arguments. Check the ArLocal documentation for more details.
Steps to Integrate with Your Project
const Arweave = require('arweave');
const arweave = Arweave.init({
host: 'localhost',
port: 1984,
protocol: 'http'
});