@terrazzo/plugin-js
TypeScript icon, indicating that this package has built-in type declarations

0.7.1 • Public • Published

⛋ @terrazzo/plugin-js

Generate JavaScript, TypeScript, and JSON from DTCG tokens.

Setup

Requires Node.js 18 or later. With that installed, run:

npm i -D @terrazzo/cli @terrazzo/plugin-js

Add a terrazzo.config.js to the root of your project with:

import { defineConfig } from "@terrazzo/cli";
import js from "@terrazzo/plugin-js";

export default defineConfig({
  outDir: "./tokens/",
  plugins: [
    js({
      js: "index.js",
      // json: "tokens.json",
    }),
  ],
});

Lastly, run:

npx tz build

And you’ll see a ./tokens/index.js file generated in your project.

Full Documentation

Package Sidebar

Install

npm i @terrazzo/plugin-js

Weekly Downloads

176

Version

0.7.1

License

MIT

Unpacked Size

27.4 kB

Total Files

16

Last publish

Collaborators

  • drewpowers