EBIA

Tag: node

Using Shell Commands in JS-Projects or in Scripts in package.json

1. ShellJS

ShellJS is a portable (Windows/Linux/OS X) implementation of Unix shell commands on top of the Node.js API. You can use it to eliminate your shell script’s dependency on Unix while still keeping its familiar and powerful commands. You can also install it globally so you can run it from outside Node projects – say goodbye to those gnarly Bash scripts!

$ npm install [-g] shelljs

2. Shx

shx is a wrapper around ShellJS Unix commands, providing an easy solution for simple Unix-like, cross-platform commands in npm package scripts.

$ npm install shx --save-dev

Difference Between ShellJS and shx

  • ShellJS: Good for writing long scripts, all in JS, running via NodeJS (e.g. node myScript.js).
  • shx: Good for writing one-off commands in npm package scripts (e.g. "clean": "shx rm -rf out/").

 

Convert from PFX to CRT/KEY

pkcs12 -in localhost.pfx -clcerts -nokeys -out localhost.crt
pkcs12 -in localhost.pfx -nocerts -nodes -out localhost.key

 

Brew node / npm Problem: Error: Cannot find module ‘semver’

  • sudo rm -rf /usr/local/lib/node_modules
  • sudo rm -rf ~/.npm
  • brew uninstall –force node
  • brew install node

Copyright © 2020 EBIA

Theme by Anders NorenUp ↑