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

properties-sync

v1.0.1

Published

Simple, synchronous .properties file reader

Readme

propertiesSync

NAME

propertiesSync - Synchronous parsing and manipulating .properties files

SYNOPSIS

const properties = require('propertiesSync');
let props = properties.readPropertiesSync('config.properties');

let aB = props.a.b;
let c = props.c;

let props2 = properties.readPropertiesSync('config2.properties');
properties.mergeProperties(props, props2);

DESCRIPTION

This module provides two functions:

  • Read .properties files using Node.js' synchronous filesystem interface. Since the files are read synchronously, an application's configuration will be available immediately.

  • Merge two objects, allowing configuration objects to be combined.

readPropertiesSync

module.readPropertiesSync(path): Object

Read a file identified by path, producing an object.

A properties file consists, roughly, of lines, each consisting of a key and a value. The result of reading a file is an object mapping keys to values. If the key is made up of segments joined by periods, the key is broken into sub-keys, i.e. namespaces, each mapping to a sub-object.

For example, the properties file:

a.b.c = 1
a.b.d = 0
a.e = 2

is read into the object structure:

{
  a: {
    b: {
      c: "1",
      d: "0",
    },
    e: "2",
  }
}

If the file does not exist, undefined is returned.

If the file contains conflicting structure, an error is thrown. An example of such conflicts:

a.b.c = 1
a.b = 2

In this example, a.b is both an object and the value "2".

mergeProperties

module.mergeProperties(target, source,...)

Recursively merge the source objects onto the target object. A target object must be specified and will be modified, and one or more source objects.

For example, given the two properties files:

a.b.c = 1
a.b.d = 2

x.y.z = "potato"
r = "elbow"

the result of merging the two objects will be:

{
  a: {
    b: {
      c: "1",
      d: "2",
    },
  },
  x: {
    z: "potato",
  },
  r: "elbow",
}

SYNTAX

A properties file consists of logical lines. Each logical line is made of:

  • A comment, beginning with '#' and continuing until the end of the line. The comment character can be escaped by a backslash ("#") to include it in a key or value.

  • A key/value pair consisting of a key ending at the first ':' or '=' character, followed by a value. Keys are broken at periods ('.'), to create namespaces.

Multiple physical lines can be combined into a single logical line by escaping the terminating newline with a backslash ('').

SEE ALSO