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 🙏

© 2024 – Pkg Stats / Ryan Hefner

safeconfig

v0.0.3

Published

Flat file configuration management with encryption.

Downloads

5

Readme

Safeconfig

This is a work in progress. =) I just wanted to add an extra level of security to my flatfile storage of some configuration values. Not too fancy, just a utility to help manage my configuration as well as keep it hidden.

This library works by reading either a previously saved config file from safeconfig, a cleartext JSON object, or creating a new configuration.

Usage

To create a new configuration safeconfig.create(filename,[password]) The only restriction here is that the file should not exist. This will create a new object to store configuration that resides within safeconfig.

To load either a previously saved configuration, or load a json object from a file safeconfig.open(filename,[password]) *note to readin a cleartext json object, you should provide no password.

To save a file safeconfig.close([filename], [password]) Providing no password, will first and foremost reatin the previous password (if it was opened with one) If this object was opened as a cleartext json object, or created without a password. It will be saved as such. the filename for this method is also optional. If no filename is provided, the filename used to open the configuration will be re-used.

Adding Configuratino Values once a configuration has been opened or created it is as simple ass safeconfig.add(key, value, [validation]) both key and value are required, key must be unique, however the value can be a nested object, array, or etc. validation is optional and is recieved as a regex, the validation was only intended to be used on string entries. However, the regex will also eb attempted to be applied to objects as well. This method will return true on success and false on failure. example: safeconfig.add("Key", "Value", /\w+/);

Updating a configuration value. safeconfig.update(key,value,[validation]) this is essentially the same as add, but will allow you to overwrite an existing key.

Deleting configuration values safeconfig.del(key) This will delete the key:value pair in the configuration.

Retrieving configuration values safeconfig.get(key) this will return the value for the given key.

Retrieve configuration validation for a particular key. safeconfig.getValidation(key) This will return the regex that was accepted from a successful add.

To get some information on the current configuration safeconfig.getInfo() this will retrieve an object that describes the current configuration.

Encryption

Currently this library uses a crypto cipher and the blowfish algorithm.