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

onaml

v0.0.4

Published

Oh No, Another Markup Language. Based on YAML, but stores considerably more object metadata.

Downloads

1

Readme

ONAML

Oh No! Another Markup Language - The Javacript version.

ONAML is a markup language / serialization format similar to JSON and, more closely, YAML. Key features of ONAML are:

  • ONAML (re)stores type information, a serialized RegExp will be restored as a RegExp.
  • The full property descriptor information is stored and restored. A read-only property will be restored as read-only.
  • Every non-trivial object or array is provided with a permanent unique id, user accessible in the (non-enumerable, read-only and hidden) __puid property.
  • Objects are deduplicated and referenced. Every non-trivial item is serialized exactly once.
  • Pluggable input and output handlers.

Usage

Obtaining & initialization:

npm install --save onaml
var ONAML = require('onaml')([configuration]);

The examples directory has two example files. Run write.js first, to populate the local disk store.

Configuration options

So far the only configuration option is:

  • storageDirectory: Directory containing serialized ONAML objects. Used for save and load functions. Default: ./onaml.store

Methods

  • serialize( object ) Serialize the given object or array. Returns a string.
  • restore( puid, string ): Return object or array with given puid, from string or string array source.
  • exists( puid ): Returns true if puid is either loaded in memory or available in the store.
  • load( puid ): Return object or array with given puid from storageDirectory/puid.onaml
  • save( puid ): Serialize object or array with puid and all children to disk.

Format

An ONAML file is only only one level deep, because of the (non-optional) referencing:

7cpfOepkqPe(!!js/Object, @@7cpfOepkqPe):
  count(!!js/number, writable=true, enumerable=true, configurable=true): 5739573
  nope(!!js/null, writable=true, enumerable=true, configurable=true): null
  myBoolean(!!js/boolean, writable=true, enumerable=true, configurable=true): true
  myBuffer(!!js/Buffer, writable=true, enumerable=true, configurable=true): AAAAAAAAAADQzOsAAAAAAA==
  myDate(!!js/Date, writable=true, enumerable=true, configurable=true): 2015-08-28T15:42:14.002Z
  childArray(!!ONAML/reference, writable=true, enumerable=true, configurable=true): 7cpfOeoLez6
  childObject(!!ONAML/reference, writable=true, enumerable=true, configurable=true): 7cpfOepkqPf

The first and non-indented line (object definition):

  1. The puid for this object
  2. Optional property attributes, between brackets:
  3. !!...: Type / prototype name
  4. @@...: puid
  5. : followed by a newline

The subsequent, indented lines:

  1. Property name
  2. Optional property attributes, between brackets:
  3. !!...: Type / prototype name
  4. @@...: puid
  5. ...: property descriptor settings
  6. : followed by the value

A linked object will have ONAML/reference as type and the referenced id as value.

License

This project is licensed as LGPLv3, the license file is included in the project directory.

The ONAML repository on GitHub

Copyright 2015 Stefan Hamminga - prjct.net