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

multidatastore

v3.2.0

Published

multiple data store

Downloads

29

Readme

multidatastore

A wrapper around multiple data stores.

multidatastore.create(drivers)

Creates an MDS instance.

Kind: static method of multidatastore
Summary: Creates an MDS instance.

| Param | Type | Description | | --- | --- | --- | | drivers | Array.<driver> | The initial MDS drivers to initialize with. |

multidatastore.singleton(owner, [options])

Creates a singleton MDS based on an owner. Useful for ensuring only one instance is created when accessing from multiple places in your code.

Kind: static method of multidatastore
Summary: Creates a singleton MDS instance.

| Param | Type | Description | | --- | --- | --- | | owner | object | The owning object. | | [options] | object | creation options |

multidatastore~Multi_Data_Store

multidatastore Interface

Kind: inner interface of multidatastore

Multi_Data_Store.init(drivers)

Initialize the MDS.

Kind: static method of Multi_Data_Store

| Param | Type | Description | | --- | --- | --- | | drivers | Array.<driver> | A an array of datastore drivers. |

Multi_Data_Store.add_driver(driver)

Add a datastore driver to the MDS.

Kind: static method of Multi_Data_Store

| Param | Type | Description | | --- | --- | --- | | driver | driver | A datastore driver. |

Multi_Data_Store.remove_driver(driver)

Removes the given driver from the MDS.

Kind: static method of Multi_Data_Store

| Param | Type | Description | | --- | --- | --- | | driver | driver | A datastore driver. |

Multi_Data_Store.stop()

Stops the MDS, calling .stop() on all drivers.

Kind: static method of Multi_Data_Store

Multi_Data_Store.put(object, [options])

Put an object into the MDS.

Kind: static method of Multi_Data_Store

| Param | Type | Description | | --- | --- | --- | | object | object | The object to store. | | [options] | object | storage options |

Multi_Data_Store.get(id, [options], [driver])

Get an object from the MDS.

Kind: static method of Multi_Data_Store

| Param | Type | Description | | --- | --- | --- | | id | string | The object id. | | [options] | object | storage options | | [driver] | driver | optionally get from a specific datastore driver |

Multi_Data_Store.find(criteria, [options], [driver])

Searches the MDS for an object based on specified criteria. Iterates through the available drivers looking for one that supports the .find() method.

Kind: static method of Multi_Data_Store
Summary: Find an object in the MDS.

| Param | Type | Description | | --- | --- | --- | | criteria | object | An object containing search criteria. | | [options] | object | search options | | [driver] | driver | optionally search a specific datastore driver |

Multi_Data_Store.find_by(criteria, [options], [driver])

Searches the MDS for an object based on a particular field. Iterates through the available drivers looking for one that supports the .find_by() method. This is useful for datastores that support special query indexing on a per-field basis.

Kind: static method of Multi_Data_Store
Summary: Find an object in the MDS using a specific field.

| Param | Type | Description | | --- | --- | --- | | criteria | object | An object containing search criteria. | | [options] | object | search options | | [driver] | driver | optionally search a specific datastore driver |

Multi_Data_Store.del(id, [options])

Deletes an object from the MDS.

Kind: static method of Multi_Data_Store
Summary: Delete an object in the MDS.

| Param | Type | Description | | --- | --- | --- | | id | string | The object id. | | [options] | object | deletion options |

Multi_Data_Store.del_by(criteria, [options], [driver])

Deletes from the MDS based on specified critera. Iterates through the available drivers looking for one that supports the .del_by() method. This is useful for datastores that support special query indexing on a per-field basis.

Kind: static method of Multi_Data_Store
Summary: Delete obect(s) from the MDS based on given criteria.

| Param | Type | Description | | --- | --- | --- | | criteria | object | An object containing search criteria. | | [options] | object | search options | | [driver] | driver | optionally search a specific datastore driver |