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 🙏

© 2024 – Pkg Stats / Ryan Hefner

dotset

v2014.9.24

Published

The Dotset File Format. One format to make your settings fine!

Downloads

8

Readme

Dotset: The Settings File Format

A format for settings.

  • It's just JSON,
  • Very readable,
  • Easy to edit (think "no trailing comma error"),
  • Simple to parse.

In many ways, it's JSON with the CoffeeScript treatment.

Also, it's a subset of YAML. YAML parsers parse Dotset.

Example

The following file example.set:

    # Comments. They're actually useful.
    name: "Dotset: The Settings File Format"
    version: 1.0
    That simple?: yes
    Can I nest?:
      - You can nest lists…
      - and: obviously
        objects: too!

… would correspond to this JSON:

    {
      "name": "Dotset: The Settings File Format",
      "version": 1.0,
      "That simple?": true,
      "Can I nest?": [
        "You can nest lists…",
        {
          "and": "obviously",
          "objects": "too!"
        }
      ]
    }

Formal

Each file is UTF-8 encoded.

Primitives:

  • dictionary

  • array

  • string

  • number

  • boolean (yes or no)

  • null (null)

  • string: either rawString or the following. String spec

Also, Strings can escape newlines. Multiline strings for you.

Number spec

  • dictionary:

    keyValue (newline keyValue)*

  • newline: ASCII character 0x0A (or 0x0D, but don't use it).

  • keyValue of indentation indent:

    string : (whitespace)+ primitive OR string : (whitespace)+ newline indent primitive

  • rawString:

    (any unicode character but - and " and digit) (any sequence of unicode character but (: (whitespace)+))* but not yes, no, null

  • indent: sequence of ASCII characters 0x20. Nothing else.

  • non-empty array of indentation indent:

    - (whitespace)+ primitive (newline indent - (whitespace)+ primitive)*

  • empty array:

    []

  • whitespace:

    (Unicode points 0x9 OR 0x20 OR 0xA0 OR 0x2000 - 0x200D OR 0x202F OR 0x205F OR 0x2060 OR 0x3000 OR 0xFEFF)+

Functional requirements

  • Arrays must conserve order.
  • Order of dictionary entries is meaningless.
  • If a dictionary has duplicate entries, only keep the last one. Don't crash, don't throw.
  • Numbers must be decoded in a format at least as precise as IEEE754.

Why?

Because I hate to see projects use .ini files. It is ugly and poorly specified (if at all).

Because I hate to see projects use .xml files. It is even uglier and supports namespaces.

Because YAML is overly complex to parse.

Because JSON is just fine, but people find it too raw and hard to edit.

I want my tabs! I want my CR-LF! I want my Big5!

Having just one possibility for invisible characters / encoding makes it easier to not screw things up. The last thing anyone wants to screw up is the config file.