Skip to content
This repository has been archived by the owner on Sep 24, 2021. It is now read-only.

jamen/template-path

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

template-path

Resolve template string as a path

const path = require('template-path')

const project = path`${process.env.HOME}/jamen/template-path`
// => /home/jamen/jamen/template-path/

Installation

$ npm install --save template-path

Usage

path tag function

path is a template string tag you use to normalize them as paths:

// Join paths together
const example1 = path`foo/${bar}/baz.json`

// Use functions in the middle of your paths
const example2 = path`${os.tmpdir()}/my-project/${uuid()}.svg`

// Deal with file extensions
const example3 = path`${__dirname}/${name}.${ext}`

License

MIT © Jamen Marz


version travis downloads license follow

About

Resolve template string as a path

Resources

License

Stars

Watchers

Forks

Packages

No packages published