Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@cobalt-ui/plugin-json

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cobalt-ui/plugin-json

Generate JSON from your design tokens schema (requires @cobalt-ui/cli)

  • 0.4.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

@cobalt-ui/plugin-json

Generate JSON output from design tokens.

npm i -D @cobalt-ui/plugin-json
// tokens.config.mjs
import json from '@cobalt-ui/plugin-json';

export default {
  plugins: [
    json({
      /** set the filename inside outDir */
      filename: './tokens.json',
    }),
  ],
};

It’s worth noting that this JSON output differs from your source tokens.json in a number of ways:

  • It’s one flat array, making iterating over all your tokens easy without deep-crawling objects
  • All values are normalized, so you won’t get unexpected missing values
  • All shared properties are filled in, e.g. if a group has a default type it will be applied to all children tokens
  • All aliases are resolved, so you don’t have to recursively crawl tokens.json yourself
  • The original token value can be found in _original
  • Information about a token’s parent group can be found in _group

So if you have need for any of the above, this format can be much friendlier to iterate over than the original schema.

FAQs

Package last updated on 01 Mar 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc