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

safetext

v0.1.0

Published

Node module allowing you to more safely store and use strings in node apps.

Downloads

4

Readme

safetext

Node module allowing you to more safely store and use strings in node apps.

What's the point?

Storing, managing, accessing, etc. passwords is hard. Wouldn't it be great if there was a tool that allowed you to keep them in one place, safely?

safetext is a tool that does not only that, but provides facilities for your app to access these passwords easily, without causing you headache.

The whole idea here is that most of the time you have connection string variables, access tokens or keys, or other sensitive text that would be super convenient to store and access in plain text, but you really shouldn't do that per security best practices.

safetext allows you to create one file in your current working directory, that stores all of these for you, encrypted in json format. You first initialize the file, and can interact with it (adding, getting, removing, etc.) values. Once this is done, you are free to check the file into version control, and you will have access to these keys in your application using the safetext library.

For the command line tool for safetext, please visit here: safetext-cmd

What's the catch?

The bummer about this, is you still end up with one "master" password that everything can be accessed with. You still need to handle/protect this with care as anyone with it could decrypt your safetext file and get your private data.

Setting Up

Install this package into your project:

npm install safetext --save

Create the safetext file

Initialize a safetext file with a master password.

safetext.init( <master password> )

Note: after you execute this, you should see a safetext file in your working directory. Keep the master password in a safe place. Once you create this file, it's almost impossible to decrypt the file without the master.

API

Please refer to the below documentation on how to interact with the safetext api.

Get contents

Get the contents of the file decrypted, provided the master password.

safetext.getContents( <master password> )

Get keys

Gets an array of keys that are present in the file.

safetext.getKeys( <master password> )

Add a key

Adds a key to the safetext store.

safetext.writeKey( <key>, <value>, <master password> )

Get value by key

Gets a specific value by key.

safetext.getKey( <key>, <master password> )

Remove a value by key

Removes a specific value by key in the safetext file.

safetext.removeKey( <key>, <master password> )

Change master password

Changes the master password of the safetext file.

safetext.changePassword( <master password>, <new password>, <new password confirm> )

Using in your app

Once you've created your safetext file in your project, it's ready to use in your application.

You can access the contents of your file through the safetext api like this:

// safestore.js
var safetext = require('safetext');
var safestore = safetext.getContents('pw');
module.exports = safestore;