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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@tiny-apps/nosql-db

v0.0.4

Published

Tiny no-sql database

Downloads

10

Readme

Installation

Go to the root of your project and run

npm install -D @tiny-apps/nosql-db

And it to .gitignore

node_modules/
dist/
...
.storage/

Usage

Import the server and start it.

import nosqlServer from '@tiny-apps/nosql-server'

const server = nosqlServer()

Then set the database to use

const db = server.use('test_database')

And just choose a collection and run any method on it

db.test_people.insertOne({
  name: 'John',
  surname: 'Dow',
  age: 31,
})

Here is the complete example

import nosqlServer from '@tiny-apps/nosql-server'

const server = nosqlServer()
const db = server.use('test_database')

db.test_people.insertOne({
  name: 'John',
  surname: 'Dow',
  age: 31,
})
// returns { ok: true, _id: xxx, count: 1 }

db.test_people.find({
  age: 31,
})
// returns [{ _id: xxx, name: 'John', surname: 'Dow', age: 31 }]

Custom folder or name

You can change the default storage folder or name by passing them as named arguments in server creation

import nosqlServer from '@tiny-apps/nosql-server'

const server = nosqlServer({
  name: 'Main Db Server',
  path: './custom-storage'
})

Special operators

Special operators are reserved keys that allow build complex queries. All special operators starts with and underscore.

const discountedUsers = db.test_people.find({
  _or: [
    { age: { _lt: 18 } },
    { age: { _gt: 65 } },
  ]
})

Available operators

Comparation operators

  • _eq. Filter where field is equal to value
  • _neq. Filter where field is not equal to value
  • _gt. Filter where field greater than value
  • _gte. Filter where field greater or equal than value
  • _lt. Filter where field lower than value
  • _lte. Filter where field lower or equal than value
  • _in. Filter where field is in value array
  • _nin. Filter where field is not in value array

Logical operators

  • _and. Filter where all condition array items matches
  • _or. Filter where at leats one condition array item matches
  • _nor. Filter where none condition array item matches
  • _not. Filter where condition not matches

Available methods

Server

  • use(_dbName). Sets the current database to _dbName
  • listDatabases(). Return an array of all databases of the server
  • createDatabase(_name). Creates a database (implicit in use())
  • dropDatabase(_name). Deletes a database

Database

  • collection(_name) o db[_name]. Sets the current collection to _name
  • listCollections(). Return an array of all collections of the database
  • createCollection(_name). Creates a collection (implicit in db.[_name])
  • dropCollection(_name). Deletes a collection

Collection

  • find(_filter). Query the collection and returns matched records
  • findOne(_filter). Returns a record if only one matches
  • count(_filter). Count the records mathed on a query
  • distinct(_field). Return distinct values of _field in a collection
  • insertOne(_record). Insert a record
  • insertMany(_recordList). Insert a list of records
  • updateOne(_filter, _record). Update a record if only one matches
  • updateMany(_filter, _record). Update records that matches
  • deleteOne(_filter). Delete a record if only one matches
  • deleteMany(_filter). Delete records that matches

Next Features

  • More query and update special operators