# nsstorage

> Minimal namespaced storage layer on top of localStorage or sessionStorage

Latest version **0.0.3** (published 2014-11-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install nsstorage
pnpm add nsstorage
yarn add nsstorage
bun add nsstorage
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2014-11-19 |
| First published | 2014-11-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Aron Kornhall |
| Maintainers | arokor |
| Keywords | namespace, localStorage, sessionStorage |

## Links

- npm: https://www.npmjs.com/package/nsstorage
- Repository: https://github.com/arokor/nsstorage
- Issues: https://github.com/arokor/nsstorage/issues
- npm.io page: https://npm.io/package/nsstorage

## 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

- 0.0.3 (latest) — 2014-11-19
- 0.0.2 — 2014-11-16

## README

#NSStorage

NSStorage is a minimal module that provides namespacing for the web storage API
(localStorage and sessionStorage). This is useful in order to prevent different
parts of your webapp to overwrite and possibly corrupt each others data.

##Usage
    var fooStorage = NSStorage.createStorage('foo', localStorage);
    var barStorage = NSStorage.createStorage('bar', localStorage);

    fooStorage.setItem('key', 'foo');
    barStorage.setItem('key', 'bar');

    fooStorage.getItem('key') // returns 'foo'
    barStorage.getItem('key') // returns 'bar'

Follow [@AronKornhall](http://twitter.com/AronKornhall) for news and updates
regarding this library.

##Install
Browserify

    npm install nsstorage

Bower

    bower install nsstorage

Global

    download nsstorage.js and include it in your app

##Test
    npm test

##Reference

###createNamespace(namespace, storage)

Creates a namespaced storage instance on top of storage

__Arguments__
 
    namespace  {String} The namespace to be used by this storage
    storage  {Object} Implementation of the web storage API
             (eg. sessionStorage or localStorage)

    returns an object implementing the web storage API

##License 

(The MIT License)

Copyright (c) 2014 Aron Kornhall <aron@kornhall.se>

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

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