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

pemcrypt

v0.3.0

Published

Read and write secure encrypted files

Readme

Pemcrypt

Install with npm.

$ npm i pemcrypt --save

Require. Show me some CommonJS/Modules love!

var pemcrypt = require('pemcrypt');

Purpose

The goal of pemcrypt is to allow you to commit sensible environment configuration values in an encrypted manner to source control. All you need to do then, is get the private key originally used to encrypt a file, and you're good to go.

Ideally, this would only be used for development configuration values. You would distribute a .pemjson file with your module, and give the private key to decrypt the file to your contributors. The upside is that you won't need to give them a new .json file every time a value needs to change, but rather just encrypt it again, and push the new .pemjson.

Make sure you add *.pem, and whatever the decrypted JSON filename is to your .gitignore. Commiting either of those would defeat the entire purpose of this module.

#pemcrypt.generateKey

Generates a .pem file the first time around. You can save it wherever you won't, but don't ever commit it to source control.

pemcrypt.generateKey(pemfile);

This method also returns the pem key right away if you want it for some reason.

#pemcrypt(options)

Creates a pemcrypt store object. This will be used to encrypt and decrypt our files. This function will look for a .pem file and load it immediately, throwing if one isn't found.

var store = pemcrypt({
    pem: pemfile,   // same one used to generate the key
    cwd: __dirname  // defaults to process.cwd()
});

#store.encrypt(storeName, persist)

Encrypts a raw .json file. This method will take a file path relative to cwd, without the .json extension. The persist parameter will determine whether the results are dumped to an encrypted .pemjson file next to the .json one.

This method is synchronous and returns the encrypted data, too.

var pemjson = store.encrypt('env/defaults');

console.log(pemjson); // garbage

#store.decrypt(storeName, persist)

Decrypts an encrypted .pemjson file. This method will take a file path relative to cwd, without the .pemjson extension. The persist parameter will determine whether the results are dumped to a decrypted .json file next to the .pemjson one.

This method is synchronous and returns the decrypted data, too.

var json = store.decrypt('env/defaults');

console.log(json); // data!