coverageShouldBeReported# javascript-core
core logic for form8ion tools related to JavaScript, like javascript-scaffolder and lift-javascript
- Usage
- Contributing
$ npm install @form8ion/javascript-core --save-prod
const {scaffoldChoice} = require('@form8ion/javascript-core');
(async () => {
await scaffoldChoice(
{foo: {scaffold: options => options}},
'foo',
{bar: 'baz'}
);
})();
A generic function that executes the scaffolder
function from a provided map
of options based on the chosen option name.
Takes three unnamed arguments:
- keys: string Name of the choice
- values: object
scaffolder
: function (required) scaffolds the choice options
Name of the choice. SHOULD match a key from the choices
object.
options object to be passed as the only argument to the chosen scaffolder
A function that installs the provided package dependencies.
Takes four unnamed arguments:
The list of package names to be installed.
Defines if the provided list of package names should be installed as prod or
dev dependencies. If "dev" is provided, the list will be installed with the
--save-exact
flag.
Filesystem path to the root of the project
Specifies the name of the package manager to be used for dependency
installation. Defaults to npm
Constants to define the valid options for dependenciesType
PROD_DEPENDENCY_TYPE
DEV_DEPENDENCY_TYPE
Constants defining the types of possible JavaScript projects
APPLICATION
PACKAGE
CLI
Constants defining the available package managers
NPM
YARN
Constants defining the available JavaScript source dialects
COMMON_JS
BABEL
ESM
TYPESCRIPT
Predicate function to determine if the project-type is one that should be published
Takes one argument:
Should be one of the project-type options
Predicate function to determine if coverage should be reported
Takes two arguments:
visibility of the project (Public
or Private
)
unit
boolean (optional) Whether the project will be unit-tested
Writes the provided config to the package.json
for the project
Accepts an options object as the only argument, with the following properties:
Filesystem path to the root of the project
The config to be written to the package.json
as the entire contents of the
file
Merges the provided config into the existing package.json
for the project
Accepts an options object as the only argument, with the following properties:
Filesystem path to the root of the project
The config to be merged with the existing contents of the package.json
Helpers for determining supported node.js versions in categories defined by package support guidelines. Refer to the release schedule for current statuses.
Returns a list of the major LTS versions currently in active or maintenance status, optionally filtered by a provided semver range.
Accepts an options object as the only argument, with the following properties:
A semver range, compatible with node-semver, to filter the list of active major LTS versions by.
Returns a list of the major versions currently not in end-of-life status, optionally filtered by a provided semver range.
Accepts an options object as the only argument, with the following properties:
A semver range, compatible with node-semver, to filter the list of active major LTS versions by.
$ nvm install
$ npm install
$ npm test