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

crafity-storage

v0.1.3

Published

Generic storage provider. Single interface or abstraction for different databases.

Downloads

37

Readme

#Crafity Storage Dependency status Travis Build Status NPM Module version

##Sample Code

var storage = require('crafity-storage');
// TODO ...

Details to come...

##Common Provider Interface

###Prototype var EventEmitter = require('events').EventEmitter;

###Provider.create([callback]) Creates a new database in the underlying data store

  • @param {Function} [callback] The function to call when the database is created
  • @throws {Error} Not implemented error

###Provider.drop([callback]) Drops an existing database from the underlying data store

  • @param {Function} [callback] The function to call when the database is dropped
  • @throws {Error} Not implemented error

###Provider.recreate([callback]) Create a new database by dropping and creating a new database

  • @param callback The callback to call when the DB is recreated
  • @throws {Error} Not implemented error

###Provider.isConnected() Check if the provider is connected to the underlying data store.

###Provider.connect([callback]) Connect to the underlying data store.

  • @param {Function} [callback] The function to call when connected
  • @throws {Error} Not implemented error

###Provider.disconnect([callback]) Disconnect from the underlying data store

  • @param {Function} [callback] The function to call when disconnected
  • @throws {Error} Not implemented error

###Provider.dispose([callback]) Dispose all the underlying resources (e.g. statefull connections)

  • @param {Function} [callback] The function to call when resources are disposed
  • @throws {Error} Not implemented error

###Provider.save(data, [callback]) Save data to the underlying data store

  • @param {Object} data The data to save
  • @param {Function} [callback] The function to call when the data is saved
  • @throws {Error} Not implemented error

###Provider.saveMany(data, [callback]) Save many item to the underlying data store at the same time

  • @param {Array} data The data to store
  • @param {Function} [callback] The function to call when the data is saved
  • @throws {Error} Not implemented error

###Provider.remove(data, [callback]) Remove data from the underlying data store

  • @param {Object} data The data to remove
  • @param {Function} [callback] The function to call when the data is removed
  • @throws {Error} Not implemented error

###Provider.removeMany(data, [callback]) Remove many items from the underlying data store

  • @param {Array} data The data to remove
  • @param {Function} [callback] The function to call when the data is removed
  • @throws {Error} Not implemented error

###Provider.findByKey(key, [callback]) Find data by key from the underlying data store

  • @param {Object} key The key of the data to fetch
  • @param {Function} [callback] The function to call when the data is fetched
  • @throws {Error} Not implemented error

###Provider.findManyByKey(key, [callback]) Find data using a key from the underlying data store

  • @param {String|Number} key The key of the data to fetched
  • @param {Function} [callback] The function to call when the data is fetched
  • @throws {Error} Not implemented error

###Provider.findById(id, rev, [callback]) Find data by id in the underlying data store

  • @param {String} id The Id of the data to fetched
  • @param {String} [rev] The Id of the data to fetched
  • @param {Function} [callback] The function to call when the data is fetched
  • @throws {Error} Not implemented error

###Provider.findAll([callback]) Find all the data from the underlying data store

  • @param {Function} [callback] The function to call when the data is fetched
  • @throws {Error} Not implemented error