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

express-json-file-crud

v0.0.7

Published

An Express module that lets you store arbitrary objects in JSON files and perform CRUD operations on them.

Downloads

41

Readme

This package helps to quickly setup a CRUD REST service using Express: You can create, read, update and delete objects using REST.

It stores data in plain JSON files. No database is required, which makes setup rapid compared to similar solutions, and therefore perfectly suitable for quickly prototyping solutions.

This package should probably not be used for productive applications, as the underlying JSON-file-based storage engine is very basic and not a replacement for a proper database.

Setup

In your express project, run npm install --save express-json-file-crud.

Then mount a CRUD route under any endpoint, e.g.:

const makeCrud = require('express-json-file-crud').makeCrud;
const carCrud = makeCrud('cars', './storage');
app.use('/cars', carCrud);

makeCrud(entityName: string, storagePath: string) takes two arguments:

  • entityName: The type of entity that will be stored using this end point.
  • storagePath: The (relative or absolute) path to a directory where one file per entity will be stored.

All entities will be stored in [storagePath]/[entityName].json. The individual [entityName].json files and storagePath will be created if they don't exist.

IDs

Objects are identified by a numeric ID. When an object is created that has no ID set or that has an ID that conflicts with an existing ID, the id property will automatically be filled (by incrementing the highest stored ID so far for the given entity).

The IDs are used to read, update and delete specific objects.

REST usage

| Action | Path | HTTP Action | Description | |--------|-----|-------------|-------------| | Create | / | POST | | | Read (list all objects) | / | GET | Returns an array of all stored entities | | Read (single object) | /:id | GET | Returns the object with the given ID | | Update (update existing object) | /:id | PUT | Updates the object with the given ID | | Delete | /:id | DELETE | deletes the object with the given ID |

When you start your express app, the cars route is now ready to be used.

POST and PUT need to contain a request header Content-Type: application/json to work properly.

For example, to create a new car, you can call

POST /cars

with a car object as the request body.

To list all cars, you can call

GET /cars

and get an array with cars back as the response body.

To get the car with the ID 1, you can call

GET /cars/1

To update it, call

PUT /cars/1

with the updated car object in the request body.

To delete the car with the ID 1:

DELETE /cars/1