Have ideas to improve npm?Join in the discussion! »

@backtrack/preset-node

0.7.2 • Public • Published

@backtrack/preset-node

npm Linux Build Status Windows Build Status Code Coverage

About

backtrack preset that sets up a node project.

Features

Installation

npm install --save-dev @backtrack/preset-node

Usage

// backtrack.config.js
 
'use strict';
 
module.exports = {
    // see settings below
    presets: [
        [
            '@backtrack/node',
            {
                mode: 'module',
                syntax: 'node',
            },
        ],
    ],
};

Settings

'use strict';
 
module.exports = {
    presets: [
        [
            '@backtrack/node',
            {
                /**
                 * Project mode type
                 *
                 * Required
                 *
                 * Available modes:
                 *     module - npm module
                 *     app - node application
                 *
                 */
                mode: 'app',
 
                /**
                 * Javascript syntax
                 *
                 * Required
                 *
                 * Available syntax:
                 *     node: Target package.json's engines.node (no compilation)
                 *
                 *     babel: Use babel to provide latest javascript features
                 *         - app requirements:
                 *             - npm install --save source-map-support core-js@3
                 *
                 *     typescript: Use Typescript
                 *         - requirements
                 *             - npm install --save-dev typescript
                 *         - app requirements:
                 *             - npm install --save source-map-support core-js@3
                 *
                 *     flow: Use flow-type
                 *         - requirements
                 *             - npm install --save-dev flow-bin
                 *         - app requirements:
                 *             - npm install --save source-map-support core-js@3
                 */
                syntax: 'typescript',
 
                /**
                 * Specify node version
                 *
                 * module default: '>=8.9.0'
                 * app default: '^10.13.0'
                 */
                nodeVersion: '^12.0.0',
 
                /**
                 * Enable/disable Windows-only features
                 *
                 * module default: true
                 * app default: false
                 */
                windows: false,
            },
        ],
    ],
};

Install

npm i @backtrack/preset-node

DownloadsWeekly Downloads

33

Version

0.7.2

License

MIT

Unpacked Size

357 kB

Total Files

49

Last publish

Collaborators

  • avatar