Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/dna-engine/node-jsdom-starter

Sample dna-engine application running on node with jsdom
https://github.com/dna-engine/node-jsdom-starter

example javascript jsdom nodejs npm starter

Last synced: about 1 month ago
JSON representation

Sample dna-engine application running on node with jsdom

Awesome Lists containing this project

README

        

# node-jsdom-starter
logo

_Sample dna-engine application running on node with jsdom_

[![License:MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://dna-engine.org/license)
[![Build](https://github.com/dna-engine/node-jsdom-starter/actions/workflows/run-spec-on-push.yaml/badge.svg)](https://github.com/dna-engine/node-jsdom-starter/actions/workflows/run-spec-on-push.yaml)

[dna-engine.org](https://dna-engine.org), a UI templating library, can be run headless (no browser) on
Node.js with the DOM provided by jsdom.

### Setup
Enter the terminal commands:
```shell
$ cd node-jsdom-starter
$ npm install
$ node app
```

### Import and Initialize
```javascript
// Imports
import { JSDOM } from 'jsdom';
import { dna } from 'dna-engine';

// Setup
const html = `




Tasks


~~title~~




`;
const dom = new JSDOM(html);
dna.initGlobal(dom.window);
```

### Output
![require dna-engine](screenshots/terminal.png)

---
[MIT License](LICENSE.txt)