# grunt-inline2js

> Inline file content (eg. HTML, CSS, or even other JS files) into JS files with Grunt

Latest version **0.1.0** (published 2014-01-01) · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2014-01-01 |
| First published | 2014-01-01 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.8.0 |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Jani Hartikainen |
| Maintainers | jhartikainen |
| Keywords | gruntplugin |

## Links

- npm: https://www.npmjs.com/package/grunt-inline2js
- Repository: https://github.com/jhartikainen/grunt-inline2js
- Issues: https://github.com/jhartikainen/grunt-inline2js/issues
- npm.io page: https://npm.io/package/grunt-inline2js

## Dependencies (2)

- [falafel](https://npm.io/package/falafel.md) ~0.3.1
- [escodegen](https://npm.io/package/escodegen.md) ~1.0.1

## Recent versions

- 0.1.0 (latest) — 2014-01-01

## README

# grunt-inline2js

Inline file content (eg. HTML, CSS, or even other JS files) into JS files with Grunt.

You can use this to for example inline templates into your JS files, inline CSS, or pretty much anything else.

The plugin works by replacing a call to a template function with the contents of the file passed as its parameter.

```js
var stuff = __tpl('path/to/file.html');
```

is turned into...

```js
var stuff = 'contents of file are put here';
```


## Task options

```js
grunt.initConfig({
  inline2js: {
    options: {
      templateFunction: '__tpl'
    },
    files: {
      src: ['src/*.js'],
      dest: 'build/'
    }
  },
});
```

The `templateFunction` option defines which function name is used as the template function. Defaults to `__tpl`.

You define which files should be processed using the standard Grunt file syntax, as shown in the `files` attribute. Note: if destionation is a directory, full path names are kept for source files.

## Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).

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