Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

workshopper-adventure-storage

Package Overview
Dependencies
Maintainers
3
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

workshopper-adventure-storage

[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coverage Status][coveralls-image]][coveralls-url] [![NPM deps][deps-image]][deps-url] [![NPM dev devp][dev-deps-image]][dev-deps-u

  • 2.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
231
decreased by-7.6%
Maintainers
3
Weekly downloads
 
Created
Source

workshopper-adventure-storage

NPM version Downloads Build Status Coverage Status NPM deps NPM dev devp

Simple storage for workshopper-adventure

Originally included as part of workshopper-adventure, mostly written by Martin Heidegger

Based on prior work of: @substack @rvagg

Install

npm install workshopper-adventure-storage --save
const storage = require('workshopper-adventure-storage')

Properties

storage.dir

The path to store data in.

storage.userDir

A default path to store data in.

Methods

const storage = require('workshopper-adventure-storage')

storage([dir[, ...]])

Accepts a sequence of paths for path.resolve to use as the storage directory.

storage.save('name', data', cb)

JSON encodes and writes a file to the storage directory. The following will save the file as index.json.

const data = {
  foo: 'bar'
}
storage.save('index', data, (err) => {
  if (err) throw err
})

storage.get('name', cb)

Retrieves and unserializes a file from storage.

storage.get('index', (err, data) => {
  if (err) throw err
  console.log(file)
})

storage.reset(cb)

Clears the storage directory.

storage.reset((err) => {
  if (err) throw err
})

FAQs

Package last updated on 12 Nov 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc