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

@turph/quickmongo

v1.4.5

Published

A simple database using mongodb atlas

Downloads

2

Readme

quick.mongo

Simple Database using MongoDB. The name is a copy of quick.db, this uses the Mongo Atlas Database to store data though

Documentation

new Database()

new database(mongo url, options)

Parameter | Type | Optional | Description --- | --- | --- | --- Mongo URL | URL | ✖ | The URL given to you by the MongoDB Atlas Connection options | Object | null | null options.name | String | ✖ | The name of the collection you want to create

Example

  const quickMongo = require('@turph/quickmongo');
  
  const database = new quickMongo('{ INSERT MONGO URL HERE }', { name: 'database' });
  db
  .on('error', err => console.log(err))
  .on('connected', info => console.log(info));

Constructor

database.set()

database.set(key, value)

Parameter | Type | Optional | Description --- | --- | --- | --- Key | String | ✖ | The key of the value Value | String / Object | ✖ | The value of the key you wish to set

Example

await database.set('foo', 'fee');

Returns Promise<Boolean>

database.get()

await database.get(key)

Parameter | Type | Optional | Description --- | --- | --- | --- key | String | ✖ | The key of that vakue you wish to find

Example

await database.get('foo'); // fee

Returns Promise<String>

database.search()

database.search(query)

Parameter | Type | Optional | Description --- | --- | --- | --- query | String | ✖ | The term you wish to search for

Example

await database.search('foo');

Returns Promise<Object>

database.find()

database.find(query)

Parameter | Type | Optional | Description --- | --- | --- | --- query | String | ✖ | The term you wish to search for

Example

await database.find('foo');

Returns Promise<Object>

database.all()

database.all()

Parameter | Type | Optional | Description --- | --- | --- | --- | | | |

Example

await database.all()

Returns Promise<Object>

database.delete()

database.delete(key)

Parameter | Type | Optional | Description --- | --- | --- | --- Key | String | ✖ | The key of the value you wish to delete

Example

await database.delete('foo');

Returns Promise<Boolean>

database.clear()

database.clear(key)

Parameter | Type | Optional | Description --- | --- | --- | --- Key | String | ✖ | The key of the value you wish to clear from your database. Note: this will delete ALL matches so perform at your own risk

Example

await database.clear('foo');

Returns Promise<Boolean>

database.push()

database.push(key, values)

Parameter | Type | Optional | Description --- | --- | --- | --- Key | String | ✖️ | The key you want to push values into Values | Array | ✖️ | The values you want to push into

Example

await database.push('foo', ['fee', 'foo'])

Returns Promise<Boolean>

Extra Information

This will not be updated frequently and will most likely only be updated for bug fixes. Extra features will not be added.

Contributors

Tur-ph