Skip to content

buttercup/buttercup-exporter

Repository files navigation

Buttercup Exporter

Export Buttercup vaults

Build Status npm version

About

This library provides methods to allow you to export Buttercup vaults to CSV.

Install by running the following:

npm install @buttercup/exporter --save

Requires NodeJS 10 or later.

Usage

Require the exporter method and pass an archive instance to it:

const fs = require("fs");
const { Vault } = require("buttercup");
const { exportVaultToCSV } = require("@buttercup/exporter");

const vault = new Vault();
vault.createGroup("General")
    .createEntry("email")
        .setProperty("username", "test@mail.com")
        .setProperty("password", "passw0rd");

exportVaultToCSV(vault).then(csv => {
    fs.writeFileSync("./test.csv", csv);
});

exportVaultToCSV takes the vault instance as the only parameter and returns a Promise.