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
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
History
- 1.0.0 - First Release
Credits
- Mauro Mandracchia - Author - Ideabile
License
This project is licensed under the MIT License - see the LICENSE.md file for details