# grunt-inlines

> inline static file's content as string varibale

Latest version **1.1.3** (published 2017-12-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install grunt-inlines
pnpm add grunt-inlines
yarn add grunt-inlines
bun add grunt-inlines
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.3 |
| Published | 2017-12-06 |
| First published | 2017-11-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | sunxiaobo |
| Maintainers | sunxiaobo |
| Keywords | grunt, inline, cssmin, grunt-inline |

## Links

- npm: https://www.npmjs.com/package/grunt-inlines
- Repository: https://github.com/suniaoo/grunt-inlines
- Homepage: https://github.com/suniaoo/grunt-inlines#readme
- Issues: https://github.com/suniaoo/grunt-inlines/issues
- npm.io page: https://npm.io/package/grunt-inlines

## Dependencies (2)

- [cssmin](https://npm.io/package/cssmin.md) ^0.4.3
- [html-minifier](https://npm.io/package/html-minifier.md) ^3.5.7

## Recent versions

- 1.1.3 (latest) — 2017-12-06
- 1.1.2 — 2017-12-02
- 1.1.1 — 2017-12-02
- 1.1.0 — 2017-12-02
- 1.0.5 — 2017-11-27
- 1.0.4 — 2017-11-27
- 1.0.3 — 2017-11-27
- 1.0.1 — 2017-11-27
- 1.0.0 — 2017-11-27

## README

## grunt-inlines

grunt-inlines helps you insert code which have been minified inline your file, it supports css and html files.

### Usage

In your Gruntfile.js, write like below: 

```js
inlines: {
  options: {
    cssmin: true,
    htmlmin: true,
    htmlminOptions: {
      // Please references https://www.npmjs.com/package/html-minifier#options-quick-reference  
    }
  },
  files: {
    src: ...,
    dist: ...
  }
}
```

then, you can invoke function **__inline** in your javascript file, just like this:

```js
// demo.js
// be sure that ./css/style.css exists
var styleCSS = __inline("./css/style.css")
var template = __inline("./html/footer.html")
```

and ./css/style.css file's content is:

```css
.name {
  color: red;  
}
```

and ./html/footer.html file's content is:

```html
<footer>
this is footer
</footer>
```

after compiled by grunt, demo.js would become: 

```js
var styleCSS = '.name{color:red}'
var template = '<footer>this is footer</footer>'
```

---
_Source: https://npm.io/package/grunt-inlines · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
