Command-line tool for running Projector scripts
First, make sure you have Yarn and Node 8 (or above) installed.
Then install the following in your project:
yarn add --dev projector-cli
Create a projector.js file
exports.build = async () => {
console.log('Hello World!');
};
Run the following command
yarn run -s projector ./path/to/projector.js build
You should see something like this
$ "/Users/me/projects/repo/node_modules/.bin/projector" "./projector.js" "build"
Hello World!
Done in 0.70s.
You can store this command inside of package.json#scripts
{
"name": "project-name",
"version": "1.0.0",
"scripts": {
"build": "projector ./projector.js build"
},
"devDependencies": {
"projector": "*"
}
}