npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@hannahnordgren/token-test

v1.0.0

Published

testing amazon style dictionary

Readme

Style Dictionary Example - BASIC

What is this?

An example of a ASD package including Android, iOS, Compose, JS, JSON, CSS, and SCSS output. It was built purely to show how to build a basic package and fiddle around with configuration and tokens for future reference.

How do I use this?

For reference mostly. It was built to try out ASD and as something to come back to when I have forgotten how to do something.

For specific topics, see below.

How to add build types

Out of the box, if running npm run style-dictionary build or npx style-dictionary build the end result will be for Android, iOS, Compose, and CSS. For other formats the following objects need to be added to the config.platforms object:

Note that the object is called web-[format type] in the following examples. The build will just output as scss or js.

SCSS

    "web-scss": {
      "transformGroup": "scss",
      "buildPath": "build/scss/",
      "files": [
        {
          "destination": "_variables.scss",
          "format": "scss/variables"
        }
      ]
    },

JS

    "web-js": {
      "transformGroup": "js",
      "buildPath": "build/js/",
      "files": [
        {
          "destination": "tokens.js",
          "format": "javascript/module"
        }
      ]
    },

JSON

    "json": {
      "transformGroup": "js",
      "buildPath": "build/json/",
      "files": [
        {
          "destination": "tokens.json",
          "format": "json"
        }
      ]
    },

Also to note, this builds EVERYTHING as is to a tokens file, no destinations by section, filters, etc. See the docs for more specific topics.

How to create tokens

Approach building token sets using Atomic Design principles.

For atom examples check out colors.json and dimensions.json. They're constructed as such, with minimal nesting and one key and value per object or nested object.

{
    "nameOfPropertyPlural" : {
        "$type": "nameOfPropertySingular",
        "keyName": {
            "value": [some primitive value type]
        }
    }
}

Next come molecules. text.json is an example, where logical groupings are made for fonts, sizes, weights, lineheights, and composed typography styles. There are examples of atoms in the same file and object, but at the bottom the molecular values exist.

Note here, as opposed to the atomic example above, that the name of the object and the $type in the object don't have to be plural and singular. The $type describes what the nested value is. So, if tha name of the key is "text"(1) and the first level below that is "fonts"(2), and the first nested value is $type is "fontFamily" (0) and then sibling selectors like "serif" or "sans" (3), to call the sans-serif font like so:

"fontFamily": "{text.fonts.sans}"

or

"0": "{1.2.3}"

Organism examples can be found in the object-values.json file, which shares some values with the text.json file for type styles, but other examples as well.

With any example, when thinking of how these objects will translate into tokens when compiled. Values may be a singular value up to a highly complex multivalue property that can be added to the style files. This is helpful to keep in mind depending on what styling standards are applied in a specific project.

Referencing token types in other objects

In the fontFamily example above, the curly braces indicate importing a value in the current token value. These references may be in separate files or in the same file.

Compiling token types

Run npm run style-dictionary build or npx style-dictionary build. The files will be compiled to where you have set the buildPath to be.

Creating a package to install

Check out this documentation from ASD on how to publish packages.