npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

angular-swx-local-storage

v1.0.0

Published

$localStorage service for use in your AngularJS applications.

Downloads

10

Readme

angular-swx-local-storage

Bower version Build Status Coverage Status

$localStorage service for use in your AngularJS applications.

Provides a key-value (string-object) storage, that is backed by localStorage with support for expiry (in days).

Objects put or retrieved from this storage are automatically serialized or deserialized by angular's toJson/fromJson.

Installation

Node Package Manager:

npm install --save-dev angular-swx-local-storage

Bower, but please see: Why we should stop using Bower - and how to do it.

bower install angular-swx-local-storage

Usage

Simply add the angular-swx-local-storage assets to your project and include them in your HTML or as part of your build process.

<script type="text/javascript" src="angular-swx-local-storage.min.js"></script>

angular-swx-local-storage.js should appear after angular.js is included. Prefer minified assets (.min) for production.

myApp.$inject = ['$localStorage'];
function myApp($localStorage) {
    // Your app code...
}

angular
    .module('myApp', ['swxLocalStorage']);

Dependencies

angular-swx-local-storage depends on angular.js, and is tested on version 1.3.14.

Supported Browsers

angular-swx-local-storage will function correctly within all browsers that support Web Storage.

For browsers with Web Storage disabled or in private browsing mode; a simple session Object fallback is used - please be aware of the limitations in this scenario.

Contributing

If one of the existing models doesn't meet your needs, fork the project, implement the model and an example using it, send us a pull request, for consideration for inclusion in the project.

A few rules for pull requests

  • Please commit to the development branch
  • All new features must come with unit test coverage
  • Bug fixes should come with unit tests that prove their fix
  • Everything should include ngdoc code comments.

Builds

First clone the repository and checkout the "development" branch make sure nodejs is installed via your system's package manager. Install gulp.js: npm install -g gulp have node download it's required modules with: npm install

Once completed; there are a number of build options available; each build process will automatically check and install dependencies through bower.

Developemnt build

To generate a development build:

gulp

This will run all tests and generate a development build; the build version will be updated v0.0.1 becomes v0.0.1-0.

Patch build

To generate a patch build:

gulp patch

This will run all tests and generate a patch build; the patch version will be updated v0.0.1-0 becomes v0.0.2.

Minor release build

To generate a minor release build:

gulp build

This will run all tests and generate a minor release build; the minor version will be updated v0.0.2 becomes v0.1.0.

Major release build

To generate a major release build:

gulp release

This will run all tests and generate a major release build; the major version will be updated v0.1.0 becomes v1.0.0.

Documentation

Documentation is generated from ngdoc code comments within the JavaScript source.

This documentation can be found within the './docs/' folder.

Tips for Testing

Unit tests are written in Jasmine.

In order to run tests without generating a build use:

gulp test:js

If you have NOT yet generated a build (as detailed above); the bower packages may not be installed and tests will fail as a result of this.

In order to install the dependencies use the following and then re-run your tests.

bower install

Scriptwerx now uses Travis CI for continuous integration. Visit our travis build page here to see the latest status.

Development & Issue Tracking

We use JIRA to capture and organize issues, assign work, and follow team activity.

You can view this project here.


The MIT License (MIT)

Copyright (c) 2015 scriptwerx

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.