ntc-bundle
v1.0.1
Published
A fork of https://chir.ag/projects/ntc/ntc.js with umd bundling
Readme
Name That Color
This is a fork of https://chir.ag/projects/ntc/ntc.js bundled with rollup to provide a CommonJS, ES Module and an UMD version.
How to use
Browser
To just use it in any javascript executed on your website you just need to import it with a script tag:
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/ntc.umd.js"></script>
<script>
console.log(ntc.name('#ff7f00'));
</script>Or you can use it as ES Module:
<script type="module">
import ntc from 'https://cdn.jsdelivr.net/npm/[email protected]/dist/ntc.esm.js';
console.log(ntc.name('#ff7f00'));
</script>Node.js
Install as node module:
$ npm install ntc-bundleThen you can use it in your code:
const ntc = require('ntc-bundle');
console.log(ntc.name('#ff7f00'));You can also load it as module:
import ntc from 'ntc-bundle';
console.log(ntc.name('#ff7f00'));