Learn how companies like Phone2Action are using npm in their front-end developmentJoin the conversation »

ansible-vault

1.0.1 • Public • Published

ansible-vault

NPM version Build Status

An Ansible vault compatible en- and decryption library for javascript

usage

encrypt

const { Vault } = require('ansible-vault')
 
const v = new Vault({ password: 'pa$$w0rd' })
v.encrypt('superSecret123').then(console.log)
 
//> $ANSIBLE_VAULT;1.1;AES256
//> 33383239333036363833303565653032383832663162356533343630623030613133623032636566
//> 6536303436646561356461623866386133623462383832620a646363626137626635353462386430
//> 34333937313366383038346135656563316236313139333933383139376333353266666436316536
//> 6335376265313432610a313537363637383264646261303637646631346137393964386432313633
//> 3666

decrypt

const { Vault } = require('ansible-vault')
 
const vault = `$ANSIBLE_VAULT;1.1;AES256
33383239333036363833303565653032383832663162356533343630623030613133623032636566
6536303436646561356461623866386133623462383832620a646363626137626635353462386430
34333937313366383038346135656563316236313139333933383139376333353266666436316536
6335376265313432610a313537363637383264646261303637646631346137393964386432313633
3666`
 
const v = new Vault({ password: 'pa$$w0rd' })
v.decrypt(vault).then(console.log)
//> superSecret123

license

MIT Licensed

references

Ansible® is a registered trademark of RedHat® (I hope this is correct...)

Keywords

Install

npm i ansible-vault

DownloadsWeekly Downloads

50

Version

1.0.1

License

MIT

Unpacked Size

7.08 kB

Total Files

5

Last publish

Collaborators

  • avatar