UNPKG

pm2

Version:

Production process manager for Node.JS applications with a built-in load balancer.

19 lines (16 loc) 454 B
var encode = module.exports = function (xs) { function bytes (s) { if (typeof s === 'string') { return s.split('').map(ord); } else if (Array.isArray(s)) { return s.reduce(function (acc, c) { return acc.concat(bytes(c)); }, []); } } return Buffer.from([ 0x1b ].concat(bytes(xs))); }; var ord = encode.ord = function ord (c) { return c.charCodeAt(0) };