# tagbuildr-node

> Standalone component and templating utility for Node JS

Latest version **0.0.2** (published 2018-05-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install tagbuildr-node
pnpm add tagbuildr-node
yarn add tagbuildr-node
bun add tagbuildr-node
```

## 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.0.2 |
| Published | 2018-05-16 |
| First published | 2018-05-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 10.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Will Busby |
| Maintainers | buzzin0609 |
| Keywords | templating, components, node, templates, node, components, html-templates, html-tags |

## Links

- npm: https://www.npmjs.com/package/tagbuildr-node
- Repository: https://github.com/buzzin0609/tagbuildr-node
- Homepage: https://github.com/buzzin0609/tagbuildr-node#readme
- Issues: https://github.com/buzzin0609/tagbuildr-node/issues
- npm.io page: https://npm.io/package/tagbuildr-node

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2018-05-16
- 0.0.1 — 2018-05-15

## README

# tagbuildr-node
Library agnostic component and templating utility for Node JS

Based off the browser version - [tagbuildr](https://github.com/buzzin0609/tagbuildr.js) - see that repository for more examples

## Library and framework agnostic

You do not need to do anything to integrate tagbuildr node with your app. Here's an example with Express:

```javascript

const tb = require('tagbuildr-node');

app.get('/some-api-request', function(req, res) {
  res.send(tb('h1.awesome-title', 'Awesome Title'));
});

```

This will send back:

```html

<h1 class="awesome-title">Awesome Title</h1>

```

## Component focussed

tagbuildr-node is best used for component based tasks e.g. sending back a list of article elements in an api call.

However, it could be used as a full templating solution. Here is a rough example in Express js style again:

```javascript

function Document(children) {
  return tb('html', children);
}

function Head() {
  return [
    tb('script|src=my-script-url.js'),
    tb('link|rel=stylesheet|type=text/css|href=my-css-url.css')
  ]
}

function Body() {
  return tb('body', [
    tb('h1.site-title', 'Hello, World!')
  ]);
}

app.get('/', function(req, res) {
  res.send(
    Document([
      Head(),
      Body()
    ])
  );
});

```

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