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

json-to-properties

v1.1.3

Published

A standalone utility to transform language files in JSON format into .properties files, and languages files in .properties format into JSON format.

Downloads

4,495

Readme

json-to-properties

npm version

A util to convert files having a .json format into .properties format, and vice versa.

Installation

npm install json-to-properties -g

Usage

Running json-to-properties will convert any .json files that are found in the current directory, into to .properties files.

Example

{
    "KEY1": {
        "KEY2": "Hello"
    },
    "KEY3":"World"
}

result in a file containing

KEY1.KEY2=Hello
KEY3=World

Options

Various options are supported, including

-c, --config

Running the util with -c expects a config file in .json format containing two attributes: src and dist, where

  • src points to the directory containing the files to process and
  • dist points to the directory where the output files will be written

Example config.json

{
    src: "c:\json\myfiles",
    dist: "c:\properties\myconvertedfiles"
}

and run with

json-to-properties -c config.json

-r, --reverse

Performs the reversal process, converting .properties files into .json files.

Example

KEY1.KEY2=Hello
KEY3=World

result into a file containing

{
    "KEY1": {
        "KEY2": "Hello"
    },
    "KEY3":"World"
}

-s, --spaces

Accepts a number value identifying the number of spaces used within the output .json file. This is used in relation with -r, --reverse

Run using

json-to-properties -r -s 4

will use 4 spaces for each indented hierarchy.

-m, --merge

Running the util with the -m, --merge option bundles the generated .properties files into one file of a given name, or bundle.properties if none is specified. The content of the bundled file are prefixed with the name of the original file.

Example

json-to-properties -m bundles the content in a file named bundle.properties

json-to-properties -m mynewbundle.properties bundles the content in a file named mynewbundle.properties

Having two files en.json and it.json both containing the json content below

{
    "KEY1" : "Hello Sir",
    "KEY2" : "How is your day?"
}

will result in a bundle file bundle.properties having the below content.

EN.KEY1=Hello Sir
EN.KEY2=How is your day?
IT.KEY1=Hello Sir
IT.KEY2=How is your day?

Note that the standard behavior is preserved, thus two properties files en.properties and it.properties are also created.

Use of merge in conjunction with -r, --reverse option

The merge process can also be combined with the -r, -reverse flag, where the specified file (or bundle.properties if none is specified) is expanded into separate json files whose name is equivalent to the first part of a key.

Example

json-to-properties -r -m or json-to-properties -rm

Having a bundle file bundle.properties with the below content

EN.KEY1=Hello Sir
EN.KEY2=How is your day?
IT.KEY1=Salve signore
IT.KEY2=Com'è la tua giornata?

will result in two files, en_rm.json and it_rm.json, having the below content respectively.

{
    "KEY1": "Hello Sir",
    "KEY2": "How is your day?"
}

and

{
    "KEY1": "Salve signore",
    "KEY2": "Com'è la tua giornata?"
}

Note that the generated json files are suffixed with _rm not to override other .json files having the same name (in this case, en.json and it.json) that could be a result of the standard behavior of the reverse process.

Try It

The sample folder contains both .json and .properties files to download and test on.