Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

micro-storage

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

micro-storage - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

.npmignore

6

dist/micro-storage.min.js
/*!
* @ProjectName micro-storage
* @Version 0.0.1
* @Version 0.0.2
* @Author lixinliang(https://github.com/lixinliang)
* @Update 2016-09-19 11:35:32 am
* @Update 2016-09-21 11:49:09 pm
*/
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.microStorage=t():e.microStorage=t()}(this,function(){return function(e){function t(r){if(o[r])return o[r].exports;var n=o[r]={exports:{},id:r,loaded:!1};return e[r].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var o={};return t.m=e,t.c=o,t.p="",t(0)}([function(e,t){"use strict";function o(e){return function(t,o){if(0!=arguments.length)return 1==arguments.length?JSON.parse(localStorage.getItem(e+"."+t)).$:(localStorage.setItem(e+"."+t,JSON.stringify({$:o})),o)}}e.exports=o}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.microStorage=t():e.microStorage=t()}(this,function(){return function(e){function t(r){if(o[r])return o[r].exports;var n=o[r]={exports:{},id:r,loaded:!1};return e[r].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var o={};return t.m=e,t.c=o,t.p="",t(0)}([function(e,t){"use strict";function o(e){return function(t,o){if(0!=arguments.length){if(1==arguments.length){var r=JSON.parse(localStorage.getItem(e+"."+t));return r?r.$:r}return localStorage.setItem(e+"."+t,JSON.stringify({$:o})),o}}}e.exports=o}])});
{
"name": "micro-storage",
"version": "0.0.1",
"version": "0.0.2",
"description": "(<1kb) A lite localStorage plugin with namespace",

@@ -5,0 +5,0 @@ "main": "dist/micro-storage.min.js",

@@ -0,2 +1,13 @@

/**
* A lite localStorage plugin with namespace
* @param {String} namespace namespace
* @return {Function} function
*/
function microStorage ( namespace ) {
/**
* Get or set value from storage
* @param {String} name key
* @param {AnyType} value value
* @return {AnyType} value
*/
return function storage ( name, value ) {

@@ -7,3 +18,4 @@ if (arguments.length == 0) {

if (arguments.length == 1) {
return JSON.parse(localStorage.getItem(`${ namespace }.${ name }`)).$;
let result = JSON.parse(localStorage.getItem(`${ namespace }.${ name }`));
return result ? result.$ : result;
}

@@ -16,3 +28,1 @@ localStorage.setItem(`${ namespace }.${ name }`, JSON.stringify({ $ : value }));

module.exports = microStorage;
// window.microStorage = microStorage;

@@ -1,1 +0,1 @@

module.exports = {"micro-storage":"/Users/lixinliang/GitHub/micro-storage/src/entry/micro-storage.js"}
module.exports = {"index":"/Users/lixinliang/GitHub/micro-storage/src/entry/index.js","micro-storage":"/Users/lixinliang/GitHub/micro-storage/src/entry/micro-storage.js"}

@@ -15,9 +15,10 @@ 'use strict';

let entry = require('./entry.js');
let entry = {};
let alias = {};
entry[packageJson.name] = require('./entry.js')[packageJson.name];
module.exports = {
entry : entry,
output : {
// path : './dist/js/',
path : './dist/',

@@ -63,3 +64,2 @@ filename : '[name].min.js',

plugins : [
// new extractTextPlugin('../css/[name].css'),
new webpack.BannerPlugin(banner),

@@ -66,0 +66,0 @@ new webpack.optimize.UglifyJsPlugin({

Sorry, the diff of this file is not supported yet

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