Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/adam-lynch/link-assets

Spits out a file containing HTML links/scripts for each of the assets given
https://github.com/adam-lynch/link-assets

Last synced: about 1 month ago
JSON representation

Spits out a file containing HTML links/scripts for each of the assets given

Awesome Lists containing this project

README

        

link-assets
==========

[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Windows Build Status][appveyor-image]][appveyor-url] [![Dependency Status][depstat-image]][depstat-url]

---

## Installation

```javascript
npm install link-assets
```

## Example usage with [Gulp](http://github.com/gulpjs/gulp)

```js
var gulp = require('gulp');
var linkAssets = require('./');

gulp.task('include', function () {
gulp.src('./css/*.css')
.pipe(linkAssets('styles.html'))
.pipe(gulp.dest('./includes/'));
});

gulp.task('default', ['include']);
```

## linkAssets(fileName, options)

PropertyDefaultDescription

bustCachefalseA time-based query string will be appended

docRootNonePath to document root so only relative paths to assets are written out. If none is passed, just the filenames are output.

lineBreaksfalseSplits asset references onto separate lines

selfCloseEmptyElementsfalsePuts closing slash on empty elements

### Notes
- Forward slashes are always used no matter which platform.

[npm-url]: https://npmjs.org/package/link-assets
[npm-image]: http://img.shields.io/npm/v/link-assets.svg?style=flat

[travis-url]: http://travis-ci.org/adam-lynch/link-assets
[travis-image]: http://img.shields.io/travis/adam-lynch/link-assets.svg?style=flat

[appveyor-url]: https://ci.appveyor.com/project/adam-lynch/link-assets/branch/master
[appveyor-image]: https://ci.appveyor.com/api/projects/status/0pqag2cjjqa5h23w/branch/master?svg=true

[depstat-url]: https://david-dm.org/adam-lynch/link-assets
[depstat-image]: https://david-dm.org/adam-lynch/link-assets.svg?style=flat