Skip to content

hoperyy/fix-colors-out-of-memory

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

fix out-of-memory actions at colors@^1.4.1

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published