Skip to content

Commit 89b5fad

Browse files
committed
1.0.6
1 parent 7297b34 commit 89b5fad

File tree

3 files changed

+43
-5
lines changed

3 files changed

+43
-5
lines changed

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# sheetify-inline [![stability][0]][1]
2+
[![npm version][2]][3] [![downloads][4]][5]
3+
4+
a plugin converts img to base64 for sheetify
5+
6+
## Command line
7+
```sh
8+
$ browserify entry.js -t [ sheetify/transform -u sheetify-inline ]
9+
```
10+
11+
## JS api
12+
```js
13+
const browserify = require('browserify')
14+
15+
browserify()
16+
.transform('sheetify/transform', { use: [ 'sheetify-inline' ] })
17+
.bundle()
18+
```
19+
20+
## Installation
21+
```sh
22+
$ npm install sheetify-inline
23+
```
24+
25+
## License
26+
[MIT](https://tldrlegal.com/license/mit-license)
27+
28+
[0]: https://img.shields.io/badge/stability-experimental-orange.svg?style=flat-square
29+
[1]: https://nodejs.org/api/documentation.html#documentation_stability_index
30+
[2]: https://img.shields.io/npm/v/sheetify-inline.svg?style=flat-square
31+
[3]: https://npmjs.org/package/sheetify-inline
32+
[4]: http://img.shields.io/npm/dm/sheetify-inline.svg?style=flat-square
33+
[5]: https://npmjs.org/package/sheetify-inline

index.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,16 @@ module.exports = transform
55

66
function transform (filename, source, options, done){
77
try {
8-
cssurl(source, (url, done2)=>{
9-
base64Img.base64(url, (err, data)=>{
8+
cssurl(source, (url, done2) => {
9+
base64Img.base64(url, (err, data) => {
10+
if (data === void 0){
11+
done2(url)
12+
return
13+
}
14+
1015
done2(data)
1116
})
12-
}, source=>{
17+
}, source => {
1318
done(null, source)
1419
})
1520
} catch (e) {

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"name": "sheetify-inline",
3-
"version": "1.0.5",
3+
"version": "1.0.6",
44
"description": "a plugin converts img to base64 for sheetify",
55
"main": "index.js",
66
"repository": "https://github.com/ZhouHansen/sheetify-inline",
77
"author": "zhouhansen",
88
"license": "MIT",
99
"dependencies": {
1010
"base64-img": "^1.0.3",
11-
"css-reurl": "^1.0.3"
11+
"css-reurl": "^1.0.5"
1212
},
1313
"devDependencies": {
1414
"tape": "^4.8.0"

0 commit comments

Comments
 (0)