# style-dictionary-esm

> Style once, use everywhere. A build system for creating cross-platform styles.

Latest version **1.9.2** (published 2023-11-28) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install style-dictionary-esm
pnpm add style-dictionary-esm
yarn add style-dictionary-esm
bun add style-dictionary-esm
```

Provides the command `style-dictionary`.

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.9.2 |
| Published | 2023-11-28 |
| First published | 2022-09-02 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 11 |
| Unpacked size | 207.9 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 4875 |
| Author | Amazon |
| Maintainers | tahul |
| Keywords | style dictionary, style, dictionary, amazon, css, design, properties, tokens, sass, scss, iOS, Android, react, react native, style guide |

## Links

- npm: https://www.npmjs.com/package/style-dictionary-esm
- Repository: https://github.com/amzn/style-dictionary
- Issues: https://github.com/amzn/style-dictionary/issues
- npm.io page: https://npm.io/package/style-dictionary-esm

## Dependencies (11)

- [glob](https://npm.io/package/glob.md) ^10.3.10
- [jiti](https://npm.io/package/jiti.md) ^1.21.0
- [chalk](https://npm.io/package/chalk.md) ^5.3.0
- [json5](https://npm.io/package/json5.md) ^2.2.3
- [consola](https://npm.io/package/consola.md) ^3.2.3
- [commander](https://npm.io/package/commander.md) ^11.1.0
- [fast-glob](https://npm.io/package/fast-glob.md) ^3.3.2
- [tinycolor2](https://npm.io/package/tinycolor2.md) ^1.6.0
- [change-case](https://npm.io/package/change-case.md) ^4.1.2
- [jsonc-parser](https://npm.io/package/jsonc-parser.md) ^3.2.0
- [lodash.template](https://npm.io/package/lodash.template.md) ^4.5.0

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 1.9.2 (latest) — 2023-11-28
- 1.9.1 — 2023-11-28
- 1.9.0 — 2023-11-28
- 1.8.4 — 2023-10-04
- 1.8.3 — 2023-10-04
- 1.8.2 — 2023-10-04
- 1.8.1 — 2023-10-04
- 1.8.0 — 2023-10-04
- 1.6.2 — 2023-08-23
- 1.6.1 — 2023-08-23
- 1.6.0 — 2023-08-23
- 1.5.0 — 2023-08-23
- 1.4.4 — 2023-08-23
- 1.4.3 — 2023-08-23
- 1.4.2 — 2023-08-23
- … 30 more at https://npm.io/package/style-dictionary-esm/versions

## README

# 🪶 style-dictionary-esm

[![NPM version](https://img.shields.io/npm/v/style-dictionary-esm?color=a1b858&label=)](https://www.npmjs.com/package/style-dictionary-esm)

An ESM-ready version of [Style Dictionary](https://github.com/amzn/style-dictionary).

- Fully **ESM-ready**
- Allows mocking `fs` dependency, improving browser support
- Replaces `console.log` by `consola`, with custom levels
- Replaces `node-sass` by `dart-sass`
- Replaces `glob` by `fast-glob`
- Drops `lodash` dependency
- **100%** coverage from upstream test suite
- [**PNPM**](https://pnpm.io/), [**tsup**](https://github.com/egoist/tsup), [**Vite**](https://vitejs.dev/) and [**Vitest**](https://vitest.dev) for the repository

## Install

```bash
npm i style-dictionary-esm
```

## Why

I love Design Tokens and the Style Dictionary API!

Migrating to ESM is a tedious task, but I need it to integrate it inside my projects and toolchains.

I would happily move this work as a PR on the original repo, if this makes sense in the project roadmap!

This is an initial step in doing a [Vite plugin](https://vitejs.dev/plugins) for [Style Dictionary](https://github.com/amzn/style-dictionary).

## Todos

- Improve tree-shaking
  - Moving formats per-file and require none by default
  - Avoid relying on global export
- Avoid relying on `fs` globally, but instead support unified storage layer
- Make tests paralellizable, currently `threads` has to be set to `false` due to `fs` mismatchs

## License

[Apache 2.0](LICENSE)

---
_Source: https://npm.io/package/style-dictionary-esm · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
