@backtrack/preset-node

0.11.1 • Public • Published

@backtrack/preset-node

npm

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
				 */
				syntax: 'typescript',

				/**
				 * Specify node version
				 *
				 * module default: '>=14.15.0'
				 * app default: '^16.13.0'
				 */
				nodeVersion: '^18.0.0',

				/**
				 * Enable/disable Windows-only features
				 *
				 * module default: true
				 * app default: false
				 */
				windows: false,
			},
		],
	],
};

Package Sidebar

Install

npm i @backtrack/preset-node

Weekly Downloads

8

Version

0.11.1

License

MIT

Unpacked Size

226 kB

Total Files

41

Last publish

Collaborators

  • chrisblossom