html-assets-inject

0.0.2 • Public • Published

html-assets-inject

Install

$ npm install --save html-assets-inject

Usage

var htmlAssetsInject = require('html-assets-inject');

htmlAssetsInject('<html><head><title>inject</title></head><body>some text...</body></html>', {
	assets: [
		{
			type: 'css',
			url: 'http://foo.com/bar.css',
			inject: 'head'
		},
		{
			type: 'js',
			url: 'http://foo.com/bar.js',
			inject: 'body'
		}
	]
});
//=> '<html><head><title>inject</title><link rel="stylesheet" href="http://foo.com/bar.css" type="text/css" /></head><body>some text...<script type="text/javascript" src="http://foo.com/bar.js"></script></body></html>'

API

htmlAssetsInject(htmlContent, options)

htmlContent

Type: string

options

Type: object

License

MIT © hzfengzilong

Readme

Keywords

none

Package Sidebar

Install

npm i html-assets-inject

Weekly Downloads

0

Version

0.0.2

License

MIT

Last publish

Collaborators

  • fengzilong