css-datauri
Embed assets in css files
Install
npm install css-datauri --save-dev
Usage
Basic Example
Convert assets to data-urls in css-files
Async
var CSSDataURI = ;;
Sync
var cssDataURISync = sync;;
Events
var CSSDataURI = ; ;
Promise
var cssDataURIPromise = promise; ;
Custom Example
Filter assets by glob pattern
Async
var CSSDataURI = ; filter: 'test/fixtures/fonts/**/*';
Sync
var cssDataURISync = sync;;
CLI
Install css-datauri
globally:
npm install css-datauri -g
Run --help
to show usage information:
Usage: css-datauri [options] <src> <dest> Options: -h, --help output usage information -V, --version output the version number -f, --filter [name] Filter assets by glob pattern -b, --base [name] Set path to asset directory
Options
options.filter
Type: Array
Default value: ['**/*']
Filter assets by glob pattern
options.base
Type: String
Default value: auto
Set path to asset directory. If not specified, it's determined from source file.