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

simple-properties-db

v1.1.0

Published

A simple file-based key-value properties database for Node.js

Downloads

42

Readme

Simple Properties DB

A lightweight Node.js library for managing key-value properties in a file-based database. It supports parsing, retrieving, updating, and deleting properties while preserving comments and formatting.

Features

  • File-Based Storage: Uses a .properties file for storing key-value pairs.
  • Supports Multiple Data Types: Handles strings, numbers, and booleans.
  • Comment Preservation: Keeps comments intact when modifying the file.
  • Simple API: Easy-to-use methods for managing properties.

Installation

npm install simple-properties-db

Usage

Import the Library

const SimplePropertiesDB = require('simple-properties-db');

Initialize the Database

const db = new SimplePropertiesDB('./config'); // Path to the directory where the file will be created

This will create a db.properties file in the specified directory if it doesn't already exist.

Set a Value

db.set('username', 'johndoe');
db.set('age', 30);
db.set('isAdmin', true);

Get a Value

const username = db.get('username'); // 'johndoe'
const age = db.get('age'); // 30
const isAdmin = db.get('isAdmin'); // true

Get All Values

const allValues = db.getAll();
console.log(allValues);
// Output: { username: 'johndoe', age: 30, isAdmin: true }

Delete a Value

db.delete('username');
console.log(db.get('username')); // undefined

Preserve Comments

If the .properties file contains comments, they will be preserved when modifying the file:

# This is a comment
username=johndoe
# Another comment
age=30

API Reference

constructor(dbPath, options)

  • dbPath: Path to the directory where the .properties file will be stored. Defaults to the current working directory.
  • options: (Optional) Additional configuration options.

set(key, value)

Sets a key-value pair in the database.

  • key: The key to set.
  • value: The value to associate with the key (string, number, or boolean).

get(key)

Retrieves the value associated with a key.

  • key: The key to retrieve.

getAll()

Retrieves all key-value pairs as an object.

delete(key)

Deletes a key-value pair from the database.

  • key: The key to delete.

Example .properties File

# User configuration
username=johndoe
age=30
isAdmin=true

Testing

Run the tests using Jest:

npm test

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome! Feel free to open an issue or submit a pull request.

Author

Developed by sjh.