First-class Twig engine for Node.js
Go to file
Eric MORAND cdeb823b73 Merge branch 'issue-610' into 'milestone/6.1.0'
Resolve Issue #610 - Make Twing easier on bundlers loaders/plugins creators

See merge request nightlycommit/twing!601
2024-03-13 14:29:12 +00:00
src Resolve issue #610 2024-03-13 14:31:26 +01:00
test Resolve issue #610 2024-03-13 14:31:26 +01: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 Resolve issue #604 2024-01-18 13:18:52 +01:00
LICENSE Improve homepage and license 2018-03-06 00:28:47 +01:00
package.json Resolve issue #610 2024-03-13 14:31:26 +01: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.