Home

Awesome

keepass.io

License Build Status Dependency Status Coverage Status NPM version Gittip

keepass.io is a Node.js library for reading and writing KeePass databases. Please note that currently only the newest database version, called KDBX, is supported. Features include so far:

Note: keepass.io is currently under active development. As such, while this library is well-tested, the API might change at anytime. Consider using it in production applications only if you're comfortable following a changelog and updating your usage accordingly.

Example

As mentioned above, keepass.io is really easy to use. The following example code opens a database, outputs its name, changes the name to 'KeePass.IO rocks!' and saves the database with new credentials. More examples are available within the examples folder.

var path = require('path');
var kpio = require('../lib');

var db = new kpio.Database();
db.addCredential(new kpio.Credentials.Password('thematrix'));
db.addCredential(new kpio.Credentials.Keyfile('apoc.key'));
db.loadFile(databasePath, function(err) {
	if(err) throw err;

	var rawDatabase = db.getRawApi().get();
	console.log('Database name: ' + rawDatabase.KeePassFile.Meta.DatabaseName);
	rawDatabase.KeePassFile.Meta.DatabaseName = 'KeePass.IO rocks!';

	db.resetCredentials();
	db.addCredential(new kpio.Credentials.Password('morpheus'));
	db.addCredential(new kpio.Credentials.Keyfile('trinity.key'));

	db.getRawApi().set(rawDatabase);
	db.saveFile(newDatabasePath, function(err) {
		if(err) throw err;
	});
});

Copyright

Copyright © 2013-2014 Pascal Mathis. All rights reserved.