5

GitHub - bitair-org/node-lift: Power up Node.js

 6 months ago
source link: https://github.com/bitair-org/node-lift
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Repository files navigation

Power up Node.js for building reliable applications.

Features

  • TypeScript importer (both CommonJS and ES module systems)
  • Test runner (integration with the built-in Node.js test runner)
  • Linter (type, syntax, style and documentation checking)
  • Formatter
  • Monorepo manager
  • Runtime type checker
  • Centralized error handler
  • Performance profiler
  • Memory leak detector

Hello World!

Save and run the hello world script to see Lift in action:

Usage:

npm i -S @bitair/lift

Import

// Filename must be explicitly prefixed with '.ts' or '.mts' or '.cts'
import { func } from './sample_module.ts'

Create a tsconfig.json file at the root of your repository with the following content:

{
  "extends": "@bitair/lift/tsconfig",
  "include": [/*Filenames or patterns to be included. Cannot be empty*/],
  "exclude": [/*Filenames or patterns to be excluded. Can be empty*/] 
}
npx lift lint
npx lift test test/*.ts

‍‍package.json

{
  "main" : "src/index.ts"
}
npx lift run .

Notes

  • The lint subcommand uses the eslint command with a default config file and --ext .ts arg. To override these, set the --config and --ext args again. Other options of the eslint command can be passed as well.
  • The test subcommand uses the node command with the --test arg. Other options of the node command can be passed as well.
  • Args must be placed after the lint, run, and test subcommands.

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK