expand-template

WebJar for expand-template

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

expand-template
Last Version

Last Version

2.0.3
Release Date

Release Date

Type

Type

jar
Description

Description

expand-template
WebJar for expand-template
Project URL

Project URL

https://www.webjars.org
Source Code Management

Source Code Management

https://github.com/ralphtheninja/expand-template

Download expand-template

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/expand-template/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>expand-template</artifactId>
    <version>2.0.3</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/expand-template/
implementation 'org.webjars.npm:expand-template:2.0.3'
// https://jarcasting.com/artifacts/org.webjars.npm/expand-template/
implementation ("org.webjars.npm:expand-template:2.0.3")
'org.webjars.npm:expand-template:jar:2.0.3'
<dependency org="org.webjars.npm" name="expand-template" rev="2.0.3">
  <artifact name="expand-template" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='expand-template', version='2.0.3')
)
libraryDependencies += "org.webjars.npm" % "expand-template" % "2.0.3"
[org.webjars.npm/expand-template "2.0.3"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

expand-template

Expand placeholders in a template string.

npm Node version Build Status JavaScript Style Guide

Install

$ npm i expand-template -S

Usage

Default functionality expands templates using {} as separators for string placeholders.

var expand = require('expand-template')()
var template = '{foo}/{foo}/{bar}/{bar}'
console.log(expand(template, {
  foo: 'BAR',
  bar: 'FOO'
}))
// -> BAR/BAR/FOO/FOO

Custom separators:

var expand = require('expand-template')({ sep: '[]' })
var template = '[foo]/[foo]/[bar]/[bar]'
console.log(expand(template, {
  foo: 'BAR',
  bar: 'FOO'
}))
// -> BAR/BAR/FOO/FOO

License

All code, unless stated otherwise, is dual-licensed under WTFPL and MIT.

Versions

Version
2.0.3
1.1.1
1.1.0