Skip to content
This repository has been archived by the owner on Dec 12, 2017. It is now read-only.

Commit

Permalink
实际上只添加了一个 sync 方法
Browse files Browse the repository at this point in the history
  • Loading branch information
lmk123 committed Nov 6, 2015
1 parent a3c76c5 commit e3fa4b6
Show file tree
Hide file tree
Showing 9 changed files with 473 additions and 399 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["es2015"]
}
9 changes: 5 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
src/jasmine-core/
node_modules/
src/*.js
!gulpfile.js
/src/jasmine-core/
/node_modules/
/src/*.js
/**/*.map
/typings/
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# chrome-storage.js

[![dependencies Status](https://img.shields.io/david/lmk123/chrome-storage-wrapper.svg?style=flat-square)](https://david-dm.org/lmk123/chrome-storage-wrapper)
[![devDependencies Status](https://img.shields.io/david/dev/lmk123/chrome-storage-wrapper.svg?style=flat-square)](https://david-dm.org/lmk123/chrome-storage-wrapper#info=devDependencies)
[![Bower Version](https://img.shields.io/bower/v/chrome-storage-wrapper.svg?style=flat-square)](https://github.com/lmk123/chrome-storage-wrapper/releases)
[![NPM Version](https://img.shields.io/npm/v/chrome-storage-wrapper.svg?style=flat-square)](https://www.npmjs.com/package/chrome-storage-wrapper)

A tiny wrapper for [chrome.storage](https://developer.chrome.com/extensions/storage) that using [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).

## Example
Expand Down Expand Up @@ -31,7 +36,7 @@ chromeStorage.set({

## Installation

Install with [Bower](http://bower.io/):
Install with [Bower](http://bower.io/):

```
bower install chrome-storage-wrapper
Expand Down Expand Up @@ -117,7 +122,7 @@ chromeStorage.set({ key1:'value1', key2:'value2' })
Removes one or more items.

```js
chromeStorage.remove([ 'key1', 'key2' })
chromeStorage.remove([ 'key1', 'key2' ])
.then(() => {
// ...
});
Expand All @@ -127,6 +132,10 @@ chromeStorage.remove([ 'key1', 'key2' })

Removes all items.

#### chromeStorage.sync([ area-from, area-to])

Sync the data from `area-from` to `area-to`.

#### chromeStorage.addChangeListener(callback[, options])

Fired when one or more items change. This function return a function, it's used by `chromeStorage.removeChangeListener`. **Note**: The changes only has the new value. See below:
Expand Down
7 changes: 4 additions & 3 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
"description" : "A tiny wrapper for chrome.storage that using Promise." ,
"ignore" : [
"**/*" ,
"!release/*",
"!README.md"
"!release/*" ,
"!README.md" ,
"!package.json"
] ,
"moduleType" : [
"amd" ,
Expand All @@ -24,6 +25,6 @@
"url" : "https://github.com/lmk123/chrome-storage-wrapper.git"
} ,
"devDependencies" : {
"jasmine-core" : "^2.0.0"
"jasmine-core" : "~2.3.4"
}
}
8 changes: 0 additions & 8 deletions gulpfile.js

This file was deleted.

12 changes: 9 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name" : "chrome-storage-wrapper" ,
"version" : "0.1.2" ,
"version" : "0.1.3" ,
"description" : "A tiny wrapper for chrome.storage that using Promise." ,
"author" : {
"name" : "Milk Lee" ,
Expand All @@ -23,7 +23,13 @@
] ,
"license" : "MIT" ,
"devDependencies" : {
"gulp" : "^3.0.0" ,
"gulp-es6-sass" : "*"
"babel-cli" : "^6.1.2" ,
"babel-preset-es2015" : "^6.1.2" ,
"bower" : "^1.6.5" ,
"tsd" : "^0.6.5"
} ,
"scripts" : {
"tsd" : "tsd" ,
"bower" : "bower"
}
}
Loading

0 comments on commit e3fa4b6

Please sign in to comment.