- String = immutable & not byte-array
- Buffer = mutable & byte-array

from fs / encoding

var ret = fs.readFileSync("./cp932.txt");
// ret is Buffer, raw bin-array
var iconv = require('iconv-lite');

// decord bin-array(cp932) to json strings
var js_str = iconv.decode(ret,'CP932');
// json strings to utf8
js_str = iconv.encode(cp932,'UTF8').toString();

npx ?

  • ./node_modules/.bin/(package-name)
  • $(npm bin)/(package-name)
  • Write npm-scripts @ package.json

npx more cool!

npm install pm2
npx pm2

  Usage: pm2 [cmd] app


    -V, --version                    output the version number
    -v --version                     get version

Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account log in.