{"action":"created","issue":{"url":"https://api.github.com/repos/medikoo/cli-color/issues/22","labels_url":"https://api.github.com/repos/medikoo/cli-color/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/medikoo/cli-color/issues/22/comments","events_url":"https://api.github.com/repos/medikoo/cli-color/issues/22/events","html_url":"https://github.com/medikoo/cli-color/issues/22","id":70447940,"number":22,"title":"es5-ext, cli-color related error","user":{"login":"StreetStrider","id":2124761,"avatar_url":"https://avatars.githubusercontent.com/u/2124761?v=3","gravatar_id":"","url":"https://api.github.com/users/StreetStrider","html_url":"https://github.com/StreetStrider","followers_url":"https://api.github.com/users/StreetStrider/followers","following_url":"https://api.github.com/users/StreetStrider/following{/other_user}","gists_url":"https://api.github.com/users/StreetStrider/gists{/gist_id}","starred_url":"https://api.github.com/users/StreetStrider/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StreetStrider/subscriptions","organizations_url":"https://api.github.com/users/StreetStrider/orgs","repos_url":"https://api.github.com/users/StreetStrider/repos","events_url":"https://api.github.com/users/StreetStrider/events{/privacy}","received_events_url":"https://api.github.com/users/StreetStrider/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-23T15:59:43Z","updated_at":"2015-04-23T17:58:36Z","closed_at":"2015-04-23T17:58:36Z","body":"Good day. I have strange error which can only be reproduced in special environment. I've tried to determine the problem myself, but I do not know `cli-color` and `es5-ext` packages well enough.\r\n\r\nHere's the problem: My project uses `console-ultimate` package of my own, depends on `cli-color` (depends on `es5-ext`). Everything works fine. But when I start project in `forever` I have constraint error:\r\n```sh\r\nRangeError: Count must be >= 0\r\n    at String.module.exports (/home/<project>/opt/<project>/node_modules/console-ultimate/node_modules/cli-color/node_modules/es5-ext/string/#/repeat/shim.js:11:23)\r\n    at Function.module.exports.defineProperties.reset (/home/<project>/opt/<project>/node_modules/console-ultimate/node_modules/cli-color/index.js:109:17)\r\n    at Object.<anonymous> (/home/<project>/opt/<project>/node_modules/console-ultimate/src/console/clear.js:5:30)\r\n    at Module._compile (module.js:456:26)\r\n    at Object.Module._extensions..js (module.js:474:10)\r\n    at Module.load (module.js:356:32)\r\n    at Function.Module._load (module.js:312:12)\r\n    at Module.require (module.js:364:17)\r\n    at require (module.js:380:17)\r\n    at Object.<anonymous> (/home/<project>/opt/<project>/node_modules/console-ultimate/src/Console.js:18:10)\r\n    at Module._compile (module.js:456:26)\r\n    at Object.Module._extensions..js (module.js:474:10)\r\n    at Module.load (module.js:356:32)\r\n    at Function.Module._load (module.js:312:12)\r\n    at Module.require (module.js:364:17)\r\n    at require (module.js:380:17)\r\nerror: Forever detected script exited with code: 8\r\n```\r\n`console-ultimate` extensively uses `cli-color`, but the only feature fails is `.clear`, I workaround it by removing `var reset = require('cli-color').reset` in `.clear`.\r\n\r\nThis issue reproduces on remote machines with Ubuntu and Centos.\r\n\r\nDo you have any ideas why this code fails? Maybe there's conflict in prototypes?"},"comment":{"url":"https://api.github.com/repos/medikoo/cli-color/issues/comments/95671240","html_url":"https://github.com/medikoo/cli-color/issues/22#issuecomment-95671240","issue_url":"https://api.github.com/repos/medikoo/cli-color/issues/22","id":95671240,"user":{"login":"medikoo","id":122434,"avatar_url":"https://avatars.githubusercontent.com/u/122434?v=3","gravatar_id":"","url":"https://api.github.com/users/medikoo","html_url":"https://github.com/medikoo","followers_url":"https://api.github.com/users/medikoo/followers","following_url":"https://api.github.com/users/medikoo/following{/other_user}","gists_url":"https://api.github.com/users/medikoo/gists{/gist_id}","starred_url":"https://api.github.com/users/medikoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/medikoo/subscriptions","organizations_url":"https://api.github.com/users/medikoo/orgs","repos_url":"https://api.github.com/users/medikoo/repos","events_url":"https://api.github.com/users/medikoo/events{/privacy}","received_events_url":"https://api.github.com/users/medikoo/received_events","type":"User","site_admin":false},"created_at":"2015-04-23T17:58:36Z","updated_at":"2015-04-23T17:58:36Z","body":"@StreetStrider it looks that height of terminal gets resolved to `0`, and that makes `repeat` to be called with `-1`.\r\n\r\nStill it's only v0.3 where this bug may occur. It's no longer the case with v1 (current version) where `reset` no longer uses `repeat`. So best would be if you just upgrade to use cli-color at v1. Mind there are some API changes, but nothing that can't be quickly patched"}}