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 🙏

© 2025 – Pkg Stats / Ryan Hefner

argonjs

v1.0.4

Published

Active Record for EcmaScript

Downloads

13

Readme

This project is currently on development and testing. so any ideas are welcome at this state while the API is being designed and tested.

you know that later you cant break things that easily.

Argon is a very simple abstraction over data

  • No relational
  • Associations
  • Validations
  • Support for mixed storage engines
  • Preprocessors
  • Processors
  • Json based
  • No query language
  • No API
  • Event Based
  • No caching (use what you like)
[Model] -> [RequestObject] -> [Storage1] -> Processors -> ? (This could be anything) -> Preprocessors
                           -> [Storage2]

So in a sense is a Model Abstraction but does not try to provide all the database features, its just takes care of the data inside the language. The features can be used or not (that is up to you), because in some cases it makes sense to use validations but not in others, or maybe you could use a database or maybe a page or even just a simple hash, the idea is that you get the same API for this things.

Argon does not optimize for networking because its not its problem, neither tries to expose an API for a certain query language, you could say that Js is your query language so do anything that you like.

It is built using Neon and this dictates some of the syntactic look and feel but i have my reasons for do it and basically is because I have some other tools on Neon that help the project and avoids trying to implement a bunch of features that do not belong here.

//Neon Class
Class('Model')({});

//Argon Model for a Ram based local Storage
Class('Model').includes(Argon.Model)({
  storage : new Argon.Storage.Local()
});

API

Model includes CustomEventSupport ValidationSupport
  storage <<Ar.Storage>>
  find(id, callback)
  all(callback)
  prototype
    getProperty(propertyName)
    setProperty(propertyName, value) -> dispatches change:propertyName
    save(callback) -> runs validations, dispatches create|save event
    destroy(callback) -> dispatches destroy event

Storage
  processors
  preprocessors
  prototype
    storage
    processors
    preprocessors
    create(requestObject, callback)
    find(requestObject, callback)
    findOne(requestObject, callback)
    update(requestObject, callback)
    remove(requestObject, callback)

ValidationSupport
  validations
  prototype
    errors
    isValid

There are a bunch of examples on the spec folder because argon is tested (whatever that means), at least the examples there run, and those are the use cases that the library is supposed to support.

but here is a simple one

Class(Todo.Model, 'Task').includes(Argon.Model, Argon.Association)({
    storage : new Argon.Storage.Local(),
    validations : {
        labelIsRequired : {
            validate : function () {
                return this.hasOwnProperty('label')
                        && typeof this.label === 'string'
                        && this.label !== ''
            },
            message : 'label is required and must be a non empty string'
        }
    }
});

Todo.Model.Task.hasOne({
    name : 'image',
    targetModel : 'Todo.Model.Image',
    targetProperty : 'taskId'
});

Todo.Model.Task.all(function (tasks) {
  console.log(tasks.length);
});