# sg-storage

> Simple storage for SUGOS

Latest version **3.0.1** (published 2017-10-22) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install sg-storage
pnpm add sg-storage
yarn add sg-storage
bun add sg-storage
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.1 |
| Published | 2017-10-22 |
| First published | 2017-01-31 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8 |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Taka Okunishi |
| Maintainers | realglobe |
| Keywords | SUGOS, Storage |

## Links

- npm: https://www.npmjs.com/package/sg-storage
- Repository: https://github.com/realglobe-Inc/sg-storage
- Homepage: https://github.com/realglobe-Inc/sg-storage#readme
- Issues: https://github.com/realglobe-Inc/sg-storage/issues
- npm.io page: https://npm.io/package/sg-storage

## Dependencies (1)

- [aredis](https://npm.io/package/aredis.md) ^1.0.0

## Alternatives

- [localforage](https://npm.io/package/localforage.md) — 6.2M weekly downloads
- [localforage-observable](https://npm.io/package/localforage-observable.md) — 30.8K weekly downloads
- [@y/y](https://npm.io/package/@y/y.md) — 30.1K weekly downloads
- [@metaobjectsdev/render](https://npm.io/package/@metaobjectsdev/render.md) — 3.5K weekly downloads
- [@ledgerhq/coin-algorand](https://npm.io/package/@ledgerhq/coin-algorand.md) — 1.1K weekly downloads

## Recent versions

- 3.0.1 (latest) — 2017-10-22
- 2.1.3 — 2017-02-01
- 2.1.2 — 2017-01-31

## README

sg-storage
==========

<!---
This file is generated by ape-tmpl. Do not update manually.
--->

<!-- Badge Start -->
<a name="badges"></a>

[![Build Status][bd_travis_shield_url]][bd_travis_url]
[![npm Version][bd_npm_shield_url]][bd_npm_url]
[![JS Standard][bd_standard_shield_url]][bd_standard_url]

[bd_repo_url]: https://github.com/realglobe-Inc/sg-storage
[bd_travis_url]: http://travis-ci.org/realglobe-Inc/sg-storage
[bd_travis_shield_url]: http://img.shields.io/travis/realglobe-Inc/sg-storage.svg?style=flat
[bd_travis_com_url]: http://travis-ci.com/realglobe-Inc/sg-storage
[bd_travis_com_shield_url]: https://api.travis-ci.com/realglobe-Inc/sg-storage.svg?token=
[bd_license_url]: https://github.com/realglobe-Inc/sg-storage/blob/master/LICENSE
[bd_codeclimate_url]: http://codeclimate.com/github/realglobe-Inc/sg-storage
[bd_codeclimate_shield_url]: http://img.shields.io/codeclimate/github/realglobe-Inc/sg-storage.svg?style=flat
[bd_codeclimate_coverage_shield_url]: http://img.shields.io/codeclimate/coverage/github/realglobe-Inc/sg-storage.svg?style=flat
[bd_gemnasium_url]: https://gemnasium.com/realglobe-Inc/sg-storage
[bd_gemnasium_shield_url]: https://gemnasium.com/realglobe-Inc/sg-storage.svg
[bd_npm_url]: http://www.npmjs.org/package/sg-storage
[bd_npm_shield_url]: http://img.shields.io/npm/v/sg-storage.svg?style=flat
[bd_standard_url]: http://standardjs.com/
[bd_standard_shield_url]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg

<!-- Badge End -->


<!-- Description Start -->
<a name="description"></a>

Simple storage for SUGOS

<!-- Description End -->


<!-- Overview Start -->
<a name="overview"></a>



<!-- Overview End -->


<!-- Sections Start -->
<a name="sections"></a>

<!-- Section from "doc/guides/01.Installation.md.hbs" Start -->

<a name="section-doc-guides-01-installation-md"></a>

Installation
-----

```bash
$ npm install sg-storage --save
```


<!-- Section from "doc/guides/01.Installation.md.hbs" End -->

<!-- Section from "doc/guides/02.Usage.md.hbs" Start -->

<a name="section-doc-guides-02-usage-md"></a>

Usage
---------

```javascript
'use strict'

const sgStorage = require('sg-storage')
const co = require('co')

// With file system (Handy, but slow)
co(function * () {
  let storage = sgStorage('var/lib/simple-storage')

  // Set hash
  yield storage.hset('foo', 'bar', 'baz')

  // Get hash all
  let item = yield storage.hgetall('foo')
  console.log(item) // -> {bar: 'baz'}
}).catch((err) => console.error(err))

// Using redis server
co(function * () {
  // See https://github.com/NodeRedis/node_redis#readme for redis options
  let storage = sgStorage.redis({
    host: '127.0.0.1',
    port: '6379',
    db: 1
  })
  // Set hash
  yield storage.hset('foo', 'bar', 'baz')

  // Get hash all
  let item = yield storage.hgetall('foo')
  console.log(item) // -> {bar: 'baz'}
}).catch((err) => console.error(err))

```


<!-- Section from "doc/guides/02.Usage.md.hbs" End -->


<!-- Sections Start -->


<!-- LICENSE Start -->
<a name="license"></a>

License
-------
This software is released under the [Apache-2.0 License](https://github.com/realglobe-Inc/sg-storage/blob/master/LICENSE).

<!-- LICENSE End -->


<!-- Links Start -->
<a name="links"></a>

Links
------

+ [node-redis][node_redis_url]
+ [SUGOS][sugos_url]
+ [Realglobe, Inc.][realglobe,_inc__url]

[node_redis_url]: https://github.com/NodeRedis/node_redis
[sugos_url]: https://github.com/realglobe-Inc/sugos
[realglobe,_inc__url]: http://realglobe.jp

<!-- Links End -->

---
_Source: https://npm.io/package/sg-storage · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
