Extract mustache tokens from a file or string.

npm install tweezers
1 downloads in the last week
9 downloads in the last month

Node.js - tweezers

build status

tweezers extracts your mustache, hogan.js, handelbars or any arbitrary tokens. It's colloquially named to stick with the "mustache" theme.


Sometimes you want to know what the mustache tokens are in a file or string before your compile and render.


npm install --save tweezers


tweeze(string, [open], [close])

Extract the tokens into an array.

var tweeze = require('tweezers');

 var data = "Hello {{name}}!\nMay I send you an email to {{email}}?"
data += "\nI'd really love to talk to you at {{email}}, please?"

var tokens = tweeze(data);
console.dir(tokens); //{ name: 1, email: 2 }


(MIT License)

Copyright 2012, JP Richardson

npm loves you