Comments (2)
Is there a way to add the polyfill?
This issue may be related and might get fixed in create-react-app
.
from ansi-colors.
Not sure, I haven't had the time to look into it much. Here's an answer on Stack Overflow: https://stackoverflow.com/a/65018686/955014
A simpler solution could be to just wrap the assignments of isWindows
and isLinux
in a try-catch, where you default to something sensible on error.
Though as I see it, I'm not sure querying process.platform and then hardcoding the behavior based on that is the best solution. For example, the reason I'm using ansi-colors
in a web app is for communication with an external device via the Web Serial API. In that regard, process.platform is not useful at all, since it only applies to the host OS, not the one being communicated with. A solution where it's possible to configure the lib during runtime whether it should use Windows or Linux ANSI seems a lot more flexible to me.
Or, perhaps web and ANSI-colored text streams from external devices is not something you wish to support, which is fine too, and then I suppose you can leave it as is :)
from ansi-colors.
Related Issues (20)
- escape colors on stdout HOT 3
- Does not support `keyword` HOT 5
- enabled is const and cannot be assigned. HOT 3
- Failing CI (AppVeyor) HOT 3
- enable funding support in settings HOT 1
- metadata suggestions HOT 1
- Minor edit needed HOT 4
- Failed to minify HOT 4
- Update benchmark results in the readme HOT 1
- support for RGB, HLS?
- Without the support for the hex() method, this lib is not an drop-in replacement for Chalk. HOT 1
- Support tagged template literals
- NO_COLOR environment variable support HOT 2
- TS 2339: Property 'theme' does not exist on type 'typeof import("node_modules/ansi-colors/types/index")' HOT 3
- What were the breaking changes, if any, in v4? HOT 2
- Fallback color when a given color (e.g. "bright" variants) are not available HOT 1
- Duplicate packages detected in the ansicolors project on Tag: 4.1.1 HOT 1
- Color sequences incorrectly terminate in Chrome HOT 3
- Is there a vscode extension? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansi-colors.