First-class Twig engine for Node.js
Go to file
2023-12-05 10:47:50 +00:00
src Clean TwingNode API 2023-12-05 10:47:50 +00:00
test Clean TwingNode API 2023-12-05 10:47:50 +00:00
.editorconfig Resolve issue #577 2023-10-30 22:37:51 +01:00
.gitignore Resolve #567 2023-04-10 23:38:11 +02:00
.nycrc.json Increase coverage to 100% 2023-11-17 16:52:44 +00:00
LICENSE Improve homepage and license 2018-03-06 00:28:47 +01:00
package.json Update URLs to documentation and issue tracker 2023-12-04 00:05:31 +00:00
README.md Update URLs to documentation and issue tracker 2023-12-04 00:05:31 +00:00
tsconfig.json Resolve issue #582 2023-11-23 23:41:29 +00:00

Twing

NPM version Build Status Coverage percentage Donate

First-class TypeScript and JavaScript Twig compiler

Prerequisites

This projects needs at least node.js 16.0.0 to run.

It is also strongly recommended to have ts-node and nyc installed globally to ease the writing of tests and the tracking of the code coverage.

Usage

Installation

npm install

Build the library

npm run build

Build and run the test suite

npm run build:test
npm run test

Build and run the test suite in a browser

npm run build:test
npm run test:browser

Writing and executing tests

Assuming one want to execute the test located in test/tests/integration/comparison/to-array.ts, one would run:

ts-node test/tests/integration/comparison/to-array.ts

It is even possible - and recommended - to track the coverage while writing tests:

nyc ts-node test/tests/integration/comparison/to-array.ts

Of course, it is also perfectly possible to pipe the result of the test to your favorite tap formatter:

test/tests/integration/comparison$ ts-node . | tap-nyan
 9   -_-_-_-_-_,------,
 0   -_-_-_-_-_|   /\_/\ 
 0   -_-_-_-_-^|__( ^ .^) 
     -_-_-_-_-  ""  "" 
  Pass!

Contributing

  • Fork this repository
  • Code
  • Implement tests using tape
  • Issue a pull request keeping in mind that all pull requests must reference an issue in the issue queue

License

Copyright © 2018-2023 Eric MORAND. Released under the 2-Clause BSD License.