@voltiso/script
TypeScript icon, indicating that this package has built-in type declarations

2.0.8 • Public • Published

@voltiso/script

NPM scripts as code.

Use in YOUR project

pnpm add -D @voltiso/script

Define some scripts

Create scripts.ts files in your project directory, or any directory above it, e.g.:

// scripts.ts
import { parallel } from '@voltiso/script'

export const build = 'tsc -b'

export const lintEslint = 'eslint .'
export const lintTsc = 'tsc --noEmit'

export const lint = parallel(lintEslint, lintTsc)

export const check = [build, lint] // sequential

export const custom = async () => {
	console.log('custom script')
	return 'pnpm publish' // optional return
}

CLI Usage

pnpm exec v [command]

...or - longer version:

pnpm exec voltiso-script [command]

The script is searched for in this order:

  1. package.json scripts
  2. scripts.ts file in the current directory
  3. scripts.ts file in the parent directory, and so on

Even if the script is found in a directory above, the cwd does NOT change. This allows defining common scripts in a parent directory, instead of duplicating them in every project.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
2.0.80latest

Version History

VersionDownloads (Last 7 Days)Published
2.0.80
2.0.70
2.0.60
2.0.50
2.0.40
2.0.30
2.0.20
2.0.10
2.0.00
1.3.20
1.3.00
1.2.00
1.1.40
1.1.30
1.1.20
1.1.10
1.1.00
1.0.20
1.0.10
1.0.00

Package Sidebar

Install

npm i @voltiso/script

Weekly Downloads

0

Version

2.0.8

License

MIT

Unpacked Size

77.9 kB

Total Files

99

Last publish

Collaborators

  • atablash