npm package: @form8ion/lift-javascript
Description: lift enhancer for details specific to the JavaScript language
Author: Matt Travi
Latest version: 3.3.0
Deprecated: the capabilities of this package are now maintained under `@form8ion/javascript`

# lift-javascript

[lift](https://github.com/form8ion/lift) [enhancer](https://github.com/form8ion/lift#enhancers-object-optional)
for details specific to the JavaScript language

<!--status-badges start -->

[![Node CI Workflow Status][github-actions-ci-badge]][github-actions-ci-link]

<!--status-badges end -->

## Table of Contents

* [Features](#features)
  * [Coming Soon](#coming-soon)
* [Usage](#usage)
  * [Installation](#installation)
  * [Example](#example)
    * [Import](#import)
    * [Execute](#execute)
  * [API](#api)
    * [`test`](#test)
      * [`projectRoot` __string__ (_required_)](#projectroot-string-required)
    * [`lift`](#lift)
      * [`projectRoot` __string__ (_required_)](#projectroot-string-required-1)
      * [`results` __object__ (_required_)](#results-object-required)
    * [`configs` __object__ (_optional_)](#configs-object-optional)
      * [`eslint` __object__ (_optional_)](#eslint-object-optional)
        * [`scope` __string__ (_required_)](#scope-string-required)
* [Contributing](#contributing)
  * [Dependencies](#dependencies)
  * [Verification](#verification)

## Features

* Adds scripts to `package.json` from results

### Coming Soon

* Install dependencies from results
* Configure eslint configs from results

## Usage

<!--consumer-badges start -->

[![MIT license][license-badge]][license-link]
[![npm][npm-badge]][npm-link]
[![Try @form8ion/lift-javascript on RunKit][runkit-badge]][runkit-link]

<!--consumer-badges end -->

### Installation

```sh
$ npm install @form8ion/lift-javascript --save-prod
```

### Example

#### Import

```javascript
import {lift, test} from '@form8ion/lift-javascript';
```

#### Execute

```javascript
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](https://eslint.org/). `eslintConfigs`
in [results](#results-object-required) 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](https://eslint.org/docs/developer-guide/shareable-configs)
packages.

## Contributing

<!--contribution-badges start -->

[![PRs Welcome][PRs-badge]][PRs-link]
[![Conventional Commits][commit-convention-badge]][commit-convention-link]
[![Commitizen friendly][commitizen-badge]][commitizen-link]
[![semantic-release][semantic-release-badge]][semantic-release-link]
[![Renovate][renovate-badge]][renovate-link]

<!--contribution-badges end -->

### Dependencies

```sh
$ nvm install
$ npm install
```

### Verification

```sh
$ npm test
```

[PRs-link]: http://makeapullrequest.com

[PRs-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg

[commit-convention-link]: https://conventionalcommits.org

[commit-convention-badge]: https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg

[commitizen-link]: http://commitizen.github.io/cz-cli/

[commitizen-badge]: https://img.shields.io/badge/commitizen-friendly-brightgreen.svg

[semantic-release-link]: https://github.com/semantic-release/semantic-release

[semantic-release-badge]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg

[renovate-link]: https://renovatebot.com

[renovate-badge]: https://img.shields.io/badge/renovate-enabled-brightgreen.svg?logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzNjkgMzY5Ij48Y2lyY2xlIGN4PSIxODkuOSIgY3k9IjE5MC4yIiByPSIxODQuNSIgZmlsbD0iI2ZmZTQyZSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTUgLTYpIi8+PHBhdGggZmlsbD0iIzhiYjVi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bGw9IiNhMzM5MDQiIGQ9Ik0yOTEgMjY0bDggOGM0IDQgNCAxMSAwIDE2bC04IDdjLTQgNS0xMSA1LTE1IDBsLTktOGM1IDUgMTIgNSAxNiAwbDgtOGM0LTQgNC0xMSAwLTE1eiIvPjxwYXRoIGZpbGw9IiNlYjZlMmQiIGQ9Ik0yNjAgMjMzbC00LTRjLTYtNi0xNy02LTIzIDAtNyA3LTcgMTcgMCAyNGw0IDRjLTQtNS00LTExIDAtMTZsOC04YzQtNCAxMS00IDE1IDB6Ii8+PHBhdGggZmlsbD0iIzEzYWNiZCIgZD0iTTEzNCAyNDhjLTQgMC04LTItMTEtNWwtMjMtMjNhMTYgMTYgMCAwMTAtMjNMMjAxIDk2YTE2IDE2IDAgMDEyMiAwbDI0IDI0YzYgNiA2IDE2IDAgMjJMMTQ2IDI0M2MtMyAzLTcgNS0xMiA1em03OC0xNDdsLTQgMi0xMDEgMTAxYTYgNiAwIDAwMCA5bDIzIDIzYTYgNiAwIDAwOSAwbDEwMS0xMDFhNiA2IDAgMDAwLTlsLTI0LTIzLTQtMnoiLz48cGF0aCBmaWxsPSIjYmY0NDA0IiBkPSJNMjg0IDMwNGMtNCAwLTgtMS0xMS00bC00Ny00N2MtNi02LTYtMTYgMC0yMmw4LThjNi02IDE2LTYgMjIgMGw0NyA0NmM2IDcgNiAxNyAwIDIzbC04IDhjLTMgMy03IDQtMTEgNHptLTM5LTc2Yy0xIDAtMyAwLTQgMmwtOCA3Yy0yIDMtMiA3IDAgOWw0NyA0N2E2IDYgMCAwMDkgMGw3LThjMy0yIDMtNiAwLTlsLTQ2LTQ2Yy0yLTItMy0yLTUtMnoiLz48L3N2Zz4=

[license-link]: LICENSE

[license-badge]: https://img.shields.io/github/license/form8ion/lift-javascript.svg

[npm-link]: https://www.npmjs.com/package/@form8ion/lift-javascript

[npm-badge]: https://img.shields.io/npm/v/@form8ion/lift-javascript.svg

[runkit-link]: https://npm.runkit.com/@form8ion/lift-javascript

[runkit-badge]: https://badge.runkitcdn.com/@form8ion/lift-javascript.svg

[github-actions-ci-link]: https://github.com/form8ion/lift-javascript/actions?query=workflow%3A%22Node.js+CI%22+branch%3Amaster

[github-actions-ci-badge]: https://github.com/form8ion/lift-javascript/workflows/Node.js%20CI/badge.svg