Skip to content

nazieb/str

Repository files navigation

str

str is a small CLI app for converting strings from and to various formats

Installation

$ npm i -g @nazieb/str

Usage

Available str commands:

base64

Encodes string to base64:

$ str base64 enc some string here 

// will output:
// c29tZSBzdHJpbmcgaGVyZQ==

Decodes base64 string to plain format:

$ str base64 dec c29tZSBzdHJpbmcgaGVyZQ== 

// will output:
// some string here

case

Converts string to different casing.

All available casings are listed on change-case library documentation

$ str case title some string here

// will output
// Some String Here

unix

Convert UNIX timestamp to human readable format, and vice-versa

$ str unix 1567494691

// will output
// 2019-09-03T07:11:31.000Z
$ str unix 2019-09-03 07:11:31

// will output
// 1567494691

Development

Some useful NPM commands during development:

npm build

Transpiles the JS files to compatible version in dist directory with Babel

npm test

Runs the tests inside __tests__ directory using Jest

npm run lint

Runs lint checking using ESLint & Prettier

npm run lint -- --fix

Auto-fix lint errors

About

Small CLI app to converting strings from and to various formats

Resources

License

Stars

Watchers

Forks

Packages

No packages published