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

@dev-your-ops/firelight

v0.2.0

Published

FireLight is a very simple and light database that allows you to share an object with several processes. It is more a shared object than a real database DO NOT use it to process massive or sensitive data!

Readme

Welcome to FireLight !

FireLight is a very simple and light database that allows you to share an object with several processes. It is more a shared object than a real database DO NOT use it to process massive or sensitive data!

Get Started

Install

yarn add @dev-your-ops/firelight

or

npm i @dev-your-ops/firelight

Usage

By default, the database file is created at the root of the project with the name "db.json".

const db = require('@dev-your-ops/firelight')
db.load()

you can give a path as an option to store the db wherever you want :

db.load('/tmp/db.json')

get a ref

const user = db.ref('/users/1')

it will take the user if it exists or will create the space for it

set data

user.set({firstname: 'john'});

if you pass true as the second argument, the new data and the old data will be merged together:

user.set({lastname: 'doe'}, true); // user.data() = {firstname: 'john', lastname: 'doe'}

access data

You can access to the ref data by using the association function:

const userData = user.data()

console.log(userData) // => {firstname: 'john'}

get ref childs

You have access to all the children of a ref.

const userChilds = db.ref('/users').childs()

console.log(userChilds) // => [Ref,...]
console.log(userChilds[0].data()) // => {firstname: 'john'}

delete ref

if you want to remove a ref and ALL OF THESE CHILDREN.

// only a user
db.ref('/users/1').delete()

// all users
db.ref('/users').delete()

Example

const db = require('@dev-your-ops/firelight')
db.load()

// subsribe to change
db.on('onload', (e) => console.log('onload:', e));
db.on('set', (e) => console.log('set:', e));
db.on('delete', (e) => console.log('delete:', e));

// create a user
const user = db.ref('/users/1')

// set user data
user.set({ name: 'test' })

// update user data
user.set({ tab: [1, 2, 3] }, true)

console.log(user.data())
// => { name: 'test', tab: [1, 2, 3] }

// Advence
console.log(db.ref("/users/2").set({name: 'user 2'}).data())
console.log(db.ref("/users").childs()[1].data())

// delete the user
db.deleteRef(user.path)

! important

if you are using nodemon or any other hot reload method, then you will need to ignore the db.json file. for example, for nodemon, add a file named "nodemon.json" with:

// nodemon.json
{
	"ignore": ["db.json"]
}

Parameters

the db object:

| Property | Type | What is it ? | | --------------------- | ---------- | ------------------------------------------------------------------------- | | ref(path) | Function | Get or create a new space to the db associeted with the gived path. | | deleteRef(path) | Function | Delete the space on the db at the gived path. | | load() | Function | Read the file from the dbPath location an load it into dbData | | save() | Function | Write the stringified data in the json db file. | | slugify(str) | Function | Replace all '/' by '-' in str | | UID() | Function | return a uuid as xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx | | dbData | Object | Is an object with containe the bd json file parsed. | | dbPath | String | The file path to save the data from thedatabasedata. |

the ref object:

| Property | Type | Return | What is it ? | | ---------------------------- | ---------- | ------------- | ----------------------------------------------------------------------------------------- | | set(data, merge) | Function | the ref | Set data of ref space (if merge is true the new and old data will be merged). | | delete() | Function | the ref | Delete the current ref | | data() | Function | the ref data | Get the ref data. | | childs() | Function | [Ref, Ref...] | Get all ref childs as an array of ref. | | path | Object | the ref path | The current ref path. | | context | Object | the db Object | The parent db object. |

Events

you can subsribe to db event to know whats happened with the data and share it between other process

// fire only at first instansiation
firelight.on( 'onload', (data) => console.log('data:', data));  // => data

firelight.on( 'set',    (e)    => console.log('set:', e));      // => {path, data, merge}
firelight.on( 'delete', (e)    => console.log('delete:', e));   // => path

you can then recreate the db object on another process

import firelight from "@dev-your-ops/firelight"

// on load
firelight.dbData = data

// on set
firelight.set({path, data, merge})

// on delete
firelight.deleteRef(path)