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

mm-record

v2.0.0

Published

Record resource extension for Matter In Motion

Downloads

14

Readme

Matter In Motion. Record resource extension

NPM Version NPM Downloads

This extension adds a record resource. Record resource doesn't provide any API. Its main purpose is to record other resources relationship metadata.

Usage

Extensions installation instructions

Record

Record is the object with fields:

  • type — string or number, type of the record.
  • sid — string or number, subject id
  • oid — string or number, optional, object id
  • ts — record timestamp
  • data — any, optional data

API

No API

Controller Methods

add(opts)

Adds a record. Available options:

  • type — string or number, type of the record.
  • sid — string or number, subject id
  • oid — string or number, optional, object id
  • data — any, data to add to the record
  • update — boolean, if true and a record already exists it will update the timestamp of the record

get(id)

Returns a record with id

getAll(opts)

Returns all the records for the options. New records first. Available options:

  • type — selects records by type
  • sid — selects records with subject id
  • oid — also filters records with object id
  • limit — limits result number

has(opts)

Checks if the record of type and with subject sid and/or object oid is available. Return true or false.

  • type — record type
  • sid — record subject id
  • oid — record object id

delete(opts)

Deletes a record

  • type — record type
  • sid — record subject id
  • oid — record object id

deleteAll(id)

Deletes all the records where sid or oid is equal to id (slow method)

search(opts)

Records search (slow method)

  • type — with type
  • sid — with sid
  • oid — with oid
  • sample — number, return a random number of records
  • limit — limits results number
  • count — counts the number of records

Last three options are exclusive.

License: MIT.