Lightweight coloured symbols for various log levels https://www.npmjs.com/package/nanosymbols
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
Nikita Karamov 148f8936af
5.1.3
7 months ago
.github Update liberapay username 7 months ago
.editorconfig Replace XO with ESLint + Prettier 7 months ago
.eslintrc.cjs Fix formatting not being applied 7 months ago
.gitattributes Require Node.js 6 4 years ago
.gitignore Require Node.js 4 5 years ago
.npmrc Require Node.js 4 5 years ago
.prettierrc Replace XO with ESLint + Prettier 7 months ago
browser.js Rename package to nanosymbols 7 months ago
index.d.ts Rename package to nanosymbols 7 months ago
index.js Remove unused comment 7 months ago
index.test.js Simplify unit tests 7 months ago
license Add own name to LICENSE 7 months ago
package.json 5.1.3 7 months ago
readme.md Fix formatting in README 7 months ago
screenshot.png Require Node.js 4 5 years ago

readme.md

nanosymbols

Lightweight coloured symbols for various log levels

import nanoSymbols from "nanosymbols";

// if Unicode supported => ℹ, ✔, ⚠, ✖
// otherwise            => i, √, ‼, ×
console.log(
  nanoSymbols.info,
  nanoSymbols.success,
  nanoSymbols.warning,
  nanoSymbols.error
);

Includes fallbacks for Windows CMD which only supports a limited character set.

Use this (instead of the original log-symbols by Sindre Sorhus), if:

  • you care for smaller install size (50 kB 12 kB)
  • you only use picocolors-based dev tools (PostCSS, Stylelint, SVGO, ...)
    • or you don't have any terminal colouring libraries at all
  • you want a faster, lighter, and more pleasant dev experience (220 MB 114 MB in node_modules, takes 22 sec 8 sec to install)

Install

npm install nanosymbols

Licence

MIT © 2021 Nikita Karamov

MIT © 2021 Sindre Sorhus