string-template
string-template copied to clipboard
A lightweight string replace engine for text-based templates
First of all, thank you for your lib :) I'm experiencing a possible bug. If I try this example: ``` const replaceTemplate = require('string-template'); const input = "https://{user}:{password}@{domain}/api/endpoint1?parameter1={parameterValue1}"; const replacements...
I have an object like this let order = { owner: { firstName: "John", lastName: "Doe" } } and this is my template let template = " hello {order.owner.firstName} {order.owner.lastName}";...
This is useful to be able to pass flattened objects to the template. So you can do: ```javascript var user = { user: { name: 'Mark' }}; var flatUser =...
I read about the module and also using it in my nodejs application in the email templates. The only thing I want to ask is how can I add conditional...
Please merge pull request #11 , this will be very useful for me. Great module!
Using version 1.0.0 on node v6.9.4: ```js const format = require("string-template") const compile = require("string-template/compile") const vars = { hostName: 'my.only.host.com', host_tenant: 'only', host_lane: 'prd', subdomain: 'my.only', } console.log(format('http://{hostName}-{host_tenant}-{host_lane}-{subdomain}', vars))...
Added an options argument to exported function which can enable the functionality of throwing an error if template pattern doesn't match any of the passed argument strings. Default behavior is...
Is there a way wherein I can use custom delimiter? I want to use {{text}} or #text# or
Hi! After using string-template on a project, I’d like to run an idea for a feature by you and gauge your interest in a pull request. Our project is an...
The main module is now exposing two methods, 'process' (formerly 'template') and 'setOpenCloseTags' The one-function structure of module.exports is thus changed, maybe requiring a version increment... As you consider best,...