void-html-data
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Void HTML Data

Void HTML Data is a way to add data to an html file.

to get this to work, you need to add {{ variable_name }} to parts of your html where it will be replaced by a value of your choosing.

example :

<!DOCTYPE html>
<head>
    <title>{{ title }}</title>
</head>
<body>
    {{ nav }}
    {{ footer }}
</body>
const { parseHTML } = require('void-html-data');

parseHTML('./test.html', './test_final.html', { title:'Hello There!', nav:'<nav>Nav</nav>', footer:'<div><p>footer</p></div>' });

this example will replace title with 'Hello There!', nav with <nav>Nav</nav> and footer with <div><p>footer</p></div>.

language?

You should be able to name the variables with any letters you want as long as it is supported by javascript.

Readme

Keywords

Package Sidebar

Install

npm i void-html-data

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

3.75 kB

Total Files

7

Last publish

Collaborators

  • mrthomas20121