# @angular-cool/storage

> Cool Storage wrapper for angular.

Latest version **13.0.1** (published 2026-07-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install @angular-cool/storage
pnpm add @angular-cool/storage
yarn add @angular-cool/storage
bun add @angular-cool/storage
```

## Health

**Score 55/100 (C)** — status: active.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 13.0.1 |
| Published | 2026-07-05 |
| First published | 2018-05-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Dependencies | 1 |
| Unpacked size | 21.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | Hacklone |
| Maintainers | hacklone |
| Keywords | angular2, angular, local-storage, localStorage, session-storage, sessionStorage, global, wrapper, cool, cool-local-storage, cool-session-storage, CoolLocalStorage, CoolSessionStorage, Universal |

## Links

- npm: https://www.npmjs.com/package/@angular-cool/storage
- Repository: https://github.com/Hacklone/angular-cool
- Homepage: https://github.com/Hacklone/angular-cool/blob/master/projects/storage/README.md
- Issues: https://github.com/Hacklone/angular-cool/issues
- npm.io page: https://npm.io/package/@angular-cool/storage

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^2.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

- 13.0.1 (latest) — 2026-07-05
- 13.0.0 — 2022-01-07
- 12.0.0 — 2020-11-26
- 11.0.0 — 2020-11-16
- 10.0.0 — 2020-09-01
- 3.0.0 — 2020-02-07
- 2.0.0 — 2020-02-07
- 1.0.3 — 2018-12-12
- 1.0.2 — 2018-10-23
- 1.0.1 — 2018-05-10
- 1.0.0 — 2018-05-09

## README

[npm-url]: https://npmjs.org/package/@angular-cool/storage
[npm-image]: https://img.shields.io/npm/v/@angular-cool/storage.svg
[downloads-image]: https://img.shields.io/npm/dm/@angular-cool/storage.svg
[total-downloads-image]: https://img.shields.io/npm/dt/@angular-cool/storage.svg

# @angular-cool/storage [![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url]  [![Total Downloads][total-downloads-image]][npm-url]
Cool angular wrapper for LocalStorage and SessionStorage with Universal support

## Install 
> npm install --save @angular-cool/storage

## Setup
```javascript
import { NgModule } from '@angular/core';
import { CoolStorageModule } from '@angular-cool/storage';

@NgModule({
    imports: [
        CoolStorageModule.forRoot(),
    ]
})
export class MyAppModule {}
```

## Features

- LocalStorage support
- SessionStorage support
- Universal support

## API
- getItem(key)
- setItem(key, value)
- removeItem(key)
- length
- clear()
- key(index)
- itemSetObservable
- itemRemovedObservable
- getObject<T>(key)
- tryGetObject<T>(key)
- setObject(key, value)

```javascript
import { Component, OnInit } from '@angular/core';

import { CoolLocalStorage } from '@angular-cool/storage';

@Component({
  selector: 'my-app'
})
export class AppComponent implements OnInit { 
    localStorage: CoolLocalStorage;
    
    constructor(localStorage: CoolLocalStorage) {
        this.localStorage = localStorage;   
    }
    
    ngOnInit() {
        this.localStorage.setItem('itemKey', 'itemValue');
        
        console.log(this.localStorage.getItem('itemKey'));
        
        this.localStorage.setObject('itemKey', {
            someObject: 3
        });
        
        console.log(this.localStorage.getObject('itemKey'));
    }
}
```

# License
> The MIT License (MIT)

> Copyright (c) 2018 Hacklone
> https://github.com/Hacklone

> 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/@angular-cool/storage · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
