{"_id":"@curvenote/ansi-to-react","name":"@curvenote/ansi-to-react","dist-tags":{"latest":"7.0.0"},"versions":{"7.0.0":{"name":"@curvenote/ansi-to-react","version":"7.0.0","description":"ANSI to React Elements","type":"module","exports":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"prepublishOnly":"npm run build && npm run test","clean":"rimraf dist","test":"vitest run","test:watch":"vitest watch","lint":"eslint \"src/**/*.ts*\" -c ./.eslintrc.cjs","lint:format":"prettier --check \"src/**/*.{ts,tsx,md}\"","build:esm":"tsc","build":"npm-run-all -l clean -p build:esm"},"engines":{"node":">=16"},"repository":{"type":"git","url":"git+https://github.com/curvenote/ansi-to-react.git"},"keywords":["ansi","react"],"publishConfig":{"access":"public"},"author":{"name":"Kyle Kelley","email":"rgbkrk@gmail.com"},"license":"BSD-3-Clause","dependencies":{"anser":"^2.1.1","escape-carriage":"^1.3.1"},"peerDependencies":{"react":"^16.3.2 || ^17.0.0 || ^18.0.0","react-dom":"^16.3.2 || ^17.0.0 || ^18.0.0"},"devDependencies":{"@types/enzyme":"^3.10.14","@types/react":"^18.2.24","@vitejs/plugin-react":"latest","@vitest/ui":"latest","@wojtekmaj/enzyme-adapter-react-17":"^0.8.0","enzyme":"^3.11.0","eslint-config-curvenote":"^0.0.3","npm-run-all":"^4.1.5","prettier":"^3.0.3","react":"^17.0.2","react-dom":"^17.0.2","rimraf":"^5.0.5","typescript":"^5.2.2","vitest":"^0.34.6"},"gitHead":"6ddf60877448cb2f835933a04fec304ff0d5566e","bugs":{"url":"https://github.com/curvenote/ansi-to-react/issues"},"homepage":"https://github.com/curvenote/ansi-to-react#readme","_id":"@curvenote/ansi-to-react@7.0.0","_nodeVersion":"18.16.1","_npmVersion":"9.5.1","dist":{"integrity":"sha512-+m4V86QPmaZ7udMp7Yg81A31dLBGO8gglkPGWPzUJNxLCSyOrJ04pQmdZQelNBEA7MSGz8wf+6RHcuEaujdhHw==","shasum":"c4dd6691bddc2c863c5dffb9c7d366a0815802eb","tarball":"https://registry.npmjs.org/@curvenote/ansi-to-react/-/ansi-to-react-7.0.0.tgz","fileCount":8,"unpackedSize":18439,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCvLyJSmDLgePtDDrmlGg14pJa6i3r4FOcXfnjDsPYtmgIhAK+zsGa900J9ntM9mJhzZnsNw35w33sE6yZid9Z0xoEq"}]},"_npmUser":{"name":"rowanc1","email":"rowanc1@gmail.com"},"directories":{},"maintainers":[{"name":"fwkoch","email":"franklinwkoch@gmail.com"},{"name":"rowanc1","email":"rowanc1@gmail.com"},{"name":"stevejpurves","email":"stevejpurves@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ansi-to-react_7.0.0_1696351443023_0.17817356298864828"},"_hasShrinkwrap":false}},"time":{"created":"2023-10-03T16:44:02.925Z","7.0.0":"2023-10-03T16:44:03.165Z","modified":"2023-10-03T16:44:03.571Z"},"maintainers":[{"name":"fwkoch","email":"franklinwkoch@gmail.com"},{"name":"rowanc1","email":"rowanc1@gmail.com"},{"name":"stevejpurves","email":"stevejpurves@gmail.com"}],"description":"ANSI to React Elements","homepage":"https://github.com/curvenote/ansi-to-react#readme","keywords":["ansi","react"],"repository":{"type":"git","url":"git+https://github.com/curvenote/ansi-to-react.git"},"author":{"name":"Kyle Kelley","email":"rgbkrk@gmail.com"},"bugs":{"url":"https://github.com/curvenote/ansi-to-react/issues"},"license":"BSD-3-Clause","readme":"# ansi-to-react\n\nThis package convert ANSI escape codes to formatted text output for React.\n\n⚠️ This is a fork of the `ansi-to-react` package that updates dependencies and moves to ESM only. ⚠️\n\n## Installation\n\n```\n$ npm install @curvenote/ansi-to-react\n```\n\n## Usage\n\n### Basic\n\nThe example below shows how we can use this package to render a string with ANSI escape codes.\n\n```jsx\nimport Ansi from '@curvenote/ansi-to-react';\n\nexport function MyComponent() {\n  return <Ansi>{'\\u001b[34mhello world'}</Ansi>;\n}\n```\n\nWill render:\n\n```html\n<code>\n  <span style=\"color:rgb(0, 0, 187)\">hello world</span>\n</code>\n```\n\n### Classes\n\nStyle with classes instead of `style` attribute.\n\n```jsx\n<Ansi useClasses>{'\\u001b[34mhello world'}</Ansi>\n```\n\nWill render\n\n```html\n<code>\n  <span class=\"ansi-blue-fg\">hello world</span>\n</code>\n```\n\n#### Class Names\n\n| Font color             | Background Color |\n| ---------------------- | ---------------- |\n| ansi-black-fg          | ansi-black-bg    |\n| ansi-red-fg            | ansi-red-bg      |\n| ansi-green-fg          | ansi-green-bg    |\n| ansi-yellow-fg         | ansi-yellow-bg   |\n| ansi-blue-fg           | ansi-blue-bg     |\n| ansi-magenta-fg        | ansi-magenta-bg  |\n| ansi-cyan-fg           | ansi-cyan-bg     |\n| ansi-white-fg          | ansi-white-bg    |\n| ansi-bright-black-fg   |\n| ansi-bright-red-fg     |\n| ansi-bright-green-fg   |\n| ansi-bright-yellow-fg  |\n| ansi-bright-blue-fg    |\n| ansi-bright-magenta-fg |\n| ansi-bright-cyan-fg    |\n| ansi-bright-white-fg   |\n\n## Development\n\nTo develop on this project, fork and clone this repository on your local machine. Before making modifications, install the project's dependencies.\n\n```\n$ npm install\n```\n\nTo run the test suite for this project, run:\n\n```\n$ npm run test\n```\n\n## Documentation\n\nWe're working on adding more documentation for this component. Stay tuned by watching this repository!\n\n## Support\n\nIf you experience an issue while using this package or have a feature request, please file an issue on the [issue board](https://github.com/curvenote/ansi-to-react/issues),\n\n## License\n\n[BSD-3-Clause](https://choosealicense.com/licenses/bsd-3-clause/)\n","readmeFilename":"README.md"}