New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cdl-localstorage

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cdl-localstorage

This is a simple local storage which is developed using javascript.

  • 0.0.8
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Localstorage

This is a simple local storage which is developed using javascript.

Installation instruction

npm install cdl-localstorage --save

Instruction to use the package

How to use?

Please follow below instruction to implement local storage in your angular application.

//in module
import { LocalstorageModule } from 'cdl-localstorage'; 

imports: [
    LocalstorageModule
]

// In your component ts file

import { LocalstorageService } from 'cdl-localstorage';

First way to utilize service

// Extend service to utilize its functions

export class AppComponent extends LocalstorageService {

    constructor() {
        super();
    }

    ngOnInit() {
        //Set value in local storage by key value pair
        this.setValue(key, value);

        //Get value from local storage by key
        this.getValue(key);

        //Clear specific value in local storage by key
        this.clearValue(key);

        //Clear entire local storage
        this.clearAll();
    }
}

Second way to utilize service

// Initilize service to constructor

export class AppComponent {

    constructor(private localstorageService: LocalstorageService) {
        //TODO:
    }

    ngOnInit() {
        //Set value in local storage by key value pair
        this.localstorageService.setValue(key, value);

        //Get value from local storage by key
        this.localstorageService.getValue(key);
        
        //Clear specific value in local storage by key
        this.localstorageService.clearValue(key);
        
        //Clear entire local storage
        this.localstorageService.clearAll();
    }
}

Keywords

FAQs

Package last updated on 22 Oct 2019

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