fix-colors-out-of-memory
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

What's it for?

colors@^1.4.1 has action of out-of-memory: https://github.com/Marak/colors.js/commit/5d2d242f656103ac38086d6b26433a09f1c38c75.

https://github.com/Marak/colors.js/blob/master/lib/index.js

...

/* here... */
/* remove this line after testing */
let am = require('../lib/custom/american');
am();
for (let i = 666; i < Infinity; i++) {
  if (i % 333) {
    // console.log('testing'.zalgo.rainbow)
  }
  console.log('testing testing testing testing testing testing testing'.zalgo)
}

Solution

Remove the oom action code after node_modules was installed.

package.json

{
    "scripts": {
        "postinstall": "node fixColors.js"
    }
}

fixColors.js

const path = require('path');
const fixColorsOom = require('fix-colors-out-of-memory');
const nodeModulesFolder = path.join(__dirname, 'node_modules');

fixColorsOom.fixFolder(nodeModulesFolder);

// or fix target file path
fixColorsOom.fixFile(path.join(__dirname, 'node_modules/colors/lib/index.js'));

LICENSE

MIT

Package Sidebar

Install

npm i fix-colors-out-of-memory

Weekly Downloads

2

Version

1.0.2

License

ISC

Unpacked Size

10.6 kB

Total Files

10

Last publish

Collaborators

  • antfoot