How to use the node-persist.set function in node-persist

To help you get started, we’ve selected a few node-persist examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gonetwork-project / gonetwork-state-channel / test / config / index.js View on Github external
          setItem: (id, item) => persist.set(id, item),
          getAllKeys: () => Promise.resolve(persist.keys()),
github gpmer / gpm.js / app / registry.ts View on Github external
async add(target: Target$) {
    const self = this;
    _.remove(
      this.repositories,
      repo =>
        repo.source === target.source &&
        repo.owner === target.owner &&
        repo.name === target.name &&
        repo.path === target.path
    );
    self.repositories.push(target);
    await storage.set(self.key, self.repositories);
  }
github gpmer / gpm.js / app / registry.ts View on Github external
async clean() {
    this.repositories = [];
    await storage.set(this.key, this.repositories);
  }
github gpmer / gpm.js / app / registry.ts View on Github external
async remove(target: Target$) {
    let before = this.repositories.slice();
    _.remove(
      this.repositories,
      repo =>
        repo.source === target.source &&
        repo.owner === target.owner &&
        repo.name === target.name &&
        repo.path === target.path
    );
    const after = this.repositories;
    if (!_.isEqual(before, after)) {
      await storage.set(this.key, this.repositories);
    }
  }