@wranggle/storage-node
TypeScript icon, indicating that this package has built-in type declarations

0.2.4 • Public • Published

@wranggle/storage-node

This @wranggle/storage-node package bundles the main feature layers and persistence adapters used in an Electron or Node environment.

This page is dedicated to installation/setup. See the main WranggleStorage documentation for additional instructions.

Setup

Installation

  1. Add the @wranggle/storage-node package to your project:

    # From the command line using yarn:
    yarn add @wranggle/storage-node
    
    # or with npm:
    npm install @wranggle/storage-node 
  2. In your JavaScript, import or require WranggleStorage:

    import { WranggleStorage } from '@wranggle/storage-node'; 
    // or:
    const { WranggleStorage } = require('@wranggle/storage-node');  

Alternatively, you can install and use just the persistence adapter and feature layers needed. (See individual package instructions.)

Create your store

Make sure your persistence library is available.

To use the sindresorhus/conf library for persistence, saving data in a json file, you can use the conf shortcut to specify you want the ConfigFileAdapter adapter. Eg:

const conf = new Conf(myConfOpts);
const store = new WranggleStorage({ conf }); 

See the ConfigFileAdapter instructions for its configuration options.

Next Steps

Next, you'll want to add some feature layers. See the main WranggleStorage documentation for instructions.

/@wranggle/storage-node/

    Package Sidebar

    Install

    npm i @wranggle/storage-node

    Weekly Downloads

    1

    Version

    0.2.4

    License

    Apache-2.0

    Unpacked Size

    19 kB

    Total Files

    9

    Last publish

    Collaborators

    • wranggle.ferbs