Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dpogue/html2js-bin
Command-line HTML inlining tool
https://github.com/dpogue/html2js-bin
Last synced: 13 days ago
JSON representation
Command-line HTML inlining tool
- Host: GitHub
- URL: https://github.com/dpogue/html2js-bin
- Owner: dpogue
- License: mit
- Created: 2016-12-22T06:32:56.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2016-12-22T06:56:06.000Z (about 8 years ago)
- Last Synced: 2024-11-08T09:45:59.369Z (2 months ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
html2js-bin
===========A node-based command-line HTML inlining tool.
```
npm install html2js-bin
```Usage
-----```
html2js [options]
```In no input file is specified, `html2js` will read from stdin.
### Options
* **output**: Optional output file, default to stdout
* **template**: A template file for wrapping the output
* **pattern**: A pattern to replace in the template fileYou can run `html2js --help` for a full listing of options.
### Example
Given `index.html`
```html
Hello World
Hello World
Hello World
```
Running
```
html2js index.html
```Output:
```javascript
'\n' +
'\n' +
' \n' +
' Hello World\n' +
' \n' +
' \n' +
'Hello World
\n' +
'Hello World
\n' +
' \n' +
''
```### Template Example
Given `template.js`
```javascript
define(function() {
return
});
```Running
```
html2js -t template.js -p '' index.html
```Output:
```javascript
define(function() {
return '\n' +
'\n' +
' \n' +
' Hello World\n' +
' \n' +
' \n' +
'Hello World
\n' +
'Hello World
\n' +
' \n' +
''
});
```Contributing
------------Contributions of bug reports, feature requests, and pull requests are greatly appreciated!
Please note that this project is released with a [Contributor Code of Conduct](https://github.com/dpogue/html2js-bin/blob/master/CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.
Licence
-------Copyright © 2016 Darryl Pogue
Licensed under the MIT Licence.