crypto-profile

1.0.1 • Public • Published

Crypto Profile

Creates and Manage profile files (~/.myAppName) with the power of encryption. Useful for store settings for CLI or just Apps.

Installation

npm install crypto-profile

Usage

Crypto Profile accept two way of initialization, interactive (for CLI apps) and has simple module.

If you would use in interactive mode be aware that the code would ask for password, if not a default password needs to be provide.

Initialization

Interactive

const profile = new require('crypto-profile')('myAppName')

If the file ~/.myAppName doesn't exists would be create, the user would be ask for a password.

Not Interactive

const profile = new require('crypto-profile')('myAppName', {interactive: false, password: 'someRandPassword'})

Consuming

The consuming part stay the same for both, only two methods are deliver behind the class get and set.

Get

profile.get('myValue', (value)=>{
  console.log('This is the store value', value)
})

Set

profile.set('myValue', 'mySpecialValueThatIsBeingSet')

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

History

  • 1.0.0 - First Release

Credits

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Readme

Keywords

none

Package Sidebar

Install

npm i crypto-profile

Weekly Downloads

5

Version

1.0.1

License

MIT

Last publish

Collaborators

  • ideabile