0.3.2 • Published 5 years ago

enchant-script v0.3.2

Weekly downloads
21
License
MIT
Repository
github
Last release
5 years ago

enchant-script

enchant-script

asciicast

yarn add -D enchant-script
# yarn tsc --init
yarn add -D ts-node typescript
{
  "scripts": {
    "selectScript": "ts-node scripts/selectScript"
  }
}

scripts/selectScript/index.ts

import { selectScript, consoleReport } from 'enchant-script';
import { scripts } from '..';

const main = async () => consoleReport(await selectScript(scripts));
main();

scripts/index.ts

import { EnchantScriptsP, betterOption } from 'enchant-script';

export const scripts = new Set<EnchantScriptsP>();

scripts.add({
  script: ['echo ok'],
  opt: {
    name: 'try echo',
    description: 'echo msg',
  },
  ...betterOption,
});

scripts.add({
  script: ['echo foo'],
  opt: {
    name: 'try echo',
    description: 'echo foo',
  },
  ...betterOption,
});
0.3.2

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago