Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
angular-storage
Advanced tools
A Storage done right for AngularJS.
localStorage
by default but if it's not available, it uses ngCookies
.Number
, you get an Number
, not a StringYou have several options:
bower install a0-angular-storage
npm install angular-storage
<script type="text/javascript" src="https://rawgit.com/auth0/angular-storage/master/dist/angular-storage.js"></script>
angular.module('app', ['angular-storage'])
.controller('Controller', function(store) {
var myObj = {
name: 'mgonto'
};
store.set('obj', myObj);
var myNewObject = store.get('obj');
angular.equals(myNewObject, myObj); // return true
store.remove('obj');
store.set('number', 2);
typeof(store.get('number')) === 'number'
});
You can also create namespaced storages if you want
angular.module('app', ['angular-storage'])
.factory('Auth0Store', function(store) {
reutrn store.getNamespacedStore('auth0');
})
.controller('Controller', function(Auth0Store) {
var myObj = {
name: 'mgonto'
};
// This will be saved in localStorage as auth0.obj
Auth0Store.set('obj', myObj);
// This will look for auth0.obj
var myNewObject = Auth0Store.get('obj');
angular.equals(myNewObject, myObj); // return true
Auth0Store.remove('obj');
store.set('number', 2);
typeof(store.get('number')) === 'number'
});
Sets a new value
to the storage with the key name
. It can be any object.
Returns the saved value
with they key name
. If you saved an object, you get an object.
Deletes the saved value
with the key name
Returns a new store
service that will use the nanespace
and delimiter
when saving and getting values like the following namespace[delimiter]key
. For example auth0.object
considering auth0
as namespace
and .
as a delimiter
This library is used in auth0-angular
Just clone the repo, run npm install
, bower install
and then gulp
to work :).
MIT
Auth0 helps you to:
FAQs
A Storage done right for AngularJS.
The npm package angular-storage receives a total of 1,254 weekly downloads. As such, angular-storage popularity was classified as popular.
We found that angular-storage demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.