@terrazzo/plugin-js
v0.2.0
Published
Generate JS, TS, and JSON from your design tokens schema (requires @terrazzo/cli)
Downloads
114
Maintainers
Readme
⛋ @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.