https://github.com/trekjs/templatly
Use Template strings for everywhere.
https://github.com/trekjs/templatly
Last synced: 7 months ago
JSON representation
Use Template strings for everywhere.
- Host: GitHub
- URL: https://github.com/trekjs/templatly
- Owner: trekjs
- License: mit
- Created: 2015-09-02T12:50:09.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-09-02T16:35:01.000Z (over 10 years ago)
- Last Synced: 2025-05-14T19:09:48.777Z (7 months ago)
- Language: JavaScript
- Homepage:
- Size: 129 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# templatly
Use Template strings for everywhere.
[![NPM version][npm-img]][npm-url]
[![Build status][travis-img]][travis-url]
[![Test coverage][coveralls-img]][coveralls-url]
[![License][license-img]][license-url]
[![Dependency status][david-img]][david-url]
## Usage
`config.toml`
```toml
[database]
url = '${env.DATABASE_URL}'
```
```js
import fs from 'fs';
import templatly from 'templatly';
let config = fs.readFileSync('config.toml', 'utf-8');
let context = templatly(config, {
env: {
DATABASE_URL: 'user@host'
}
});
// context
/*
[database]
url = 'user@host'
*/
// ...
```
## License
[MIT](LICENSE)
[npm-img]: https://img.shields.io/npm/v/templatly.svg?style=flat-square
[npm-url]: https://npmjs.org/package/templatly
[travis-img]: https://img.shields.io/travis/trekjs/templatly.svg?style=flat-square
[travis-url]: https://travis-ci.org/trekjs/templatly
[coveralls-img]: https://img.shields.io/coveralls/trekjs/templatly.svg?style=flat-square
[coveralls-url]: https://coveralls.io/r/trekjs/templatly
[license-img]: https://img.shields.io/badge/license-MIT-green.svg?style=flat-square
[license-url]: LICENSE
[david-img]: https://img.shields.io/david/trekjs/templatly.svg?style=flat-square
[david-url]: https://david-dm.org/trekjs/templatly