str
is a small CLI app for converting strings from and to various formats
$ npm i -g @nazieb/str
Available str
commands:
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
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
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
Some useful NPM commands during development:
Transpiles the JS files to compatible version in dist
directory with Babel
Runs the tests inside __tests__
directory using Jest
Runs lint checking using ESLint & Prettier
Auto-fix lint errors