6.0.5 • Published 3 months ago

@melfore/clibelt v6.0.5

Weekly downloads
10
License
MIT
Repository
github
Last release
3 months ago

clibelt

CLI belt: the Melfore tool belt

Usage

Install

npm install @melfore/clibelt

Add scripts to package.json

Add required CLIs to your package.json, for example:

"scripts": {
  "i18n": "i18n-msg",
  "i18n:copy": "i18n-copy --from it --to fr",
  "pwd2hash": "pwd2hash"
}

Configure

There are three ways to configure a CLI.

Clibelt configuration

Create a file .clibelt.json in project root.

Configuration example:

{
  "i18nMsg": {
    "input": "./resources/messages-all-langs.js",
    "outMsg": "./src/messages",
    "outTs": "./src/messages/i18nMessages.ts"
  }
}

Command line arguments

Add arguments to script in package.json, for example:

"scripts": {
  "i18n": "i18n-msg --input new/path --outTs new/constants.ts"
}

Environment variables

Run script with CLI's specific env variables set.

CLIs

i18n-msg

i18n-msg:

  • splits an input file containing all the translations into one file for each language
  • creates a TypeScript source containing a constant for each message.

Configuration

Add i18nMsg to .clibelt.json.

Options
.clibelt paramcommand line argenv variableDescriptionExample
inputi18n-inputI18N_INPUTthe input file containing all translations./resources/messages-all-langs
outMsgi18n-out-msgI18N_OUT_MSGsplitted messages output directory./src/messages
outTsi18n-out-tsI18N_OUT_TSTypeScript constants output file./src/messages/i18nMessages.ts

Example:

{
  "i18nMsg": {
    "input": "./resources/messages-all-langs.js",
    "outMsg": "./src/messages",
    "outTs": "./src/messages/i18nMessages.ts"
  }
}

pwd2hash

pwd2hash generates an hash for input string

Configuration

No configuration is required, just add to package.json script and run:

npm run pwd2hash string_to_hash

test

6.0.5

3 months ago

6.0.3

4 months ago

6.0.4

4 months ago

6.0.2

4 months ago

6.0.1

5 months ago

3.0.2

5 months ago

5.0.0

5 months ago

6.0.0

5 months ago

4.0.0

5 months ago

3.0.1

5 months ago

3.0.0

5 months ago

2.0.0

7 months ago

1.0.2

1 year ago

1.0.1

2 years ago

1.0.0

2 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.0

4 years ago