lift-javascript
lift enhancer for details specific to the JavaScript language
Table of Contents
Features
- Adds scripts to
package.json
from results
Coming Soon
- Install dependencies from results
- Configure eslint configs from results
Usage
Installation
$ npm install @form8ion/lift-javascript --save-prod
Example
Import
import {lift, test} from '@form8ion/lift-javascript';
Execute
const projectRoot = process.cwd();
(async () => {
if (await test({projectRoot})) {
await lift({
projectRoot,
configs: {eslint: {scope: '@foo'}},
results: {
dependencies: [],
devDependencies: [],
scripts: {},
eslintConfigs: [],
packageManager: 'npm'
}
});
}
})();
API
test
predicate function that returns true
when the project is a JavaScript project
Arguments:
projectRoot
string (required)
path to the root of the project
lift
function that takes results from a JavaScript sub-scaffolder and applies the necessary changes to an existing project
Arguments:
projectRoot
string (required)
path to the root of the project
results
object (required)
results from sub-scaffolder
configs
object (optional)
eslint
object (optional)
Config details scaffolding for ESLint. eslintConfigs
in results will only be processed if these details
are provided.
scope
string (required)
The npm scope to be used when installing and configuring use of shareable ESLint config packages.
Contributing
Dependencies
$ nvm install
$ npm install
Verification
$ npm test