File tree Expand file tree Collapse file tree 3 files changed +43
-5
lines changed
Expand file tree Collapse file tree 3 files changed +43
-5
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change @@ -5,11 +5,16 @@ module.exports = transform
55
66function 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 ) {
Original file line number Diff line number Diff line change 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"
You can’t perform that action at this time.
0 commit comments