UNPKG

charlike

Version:

Small, fast, simple and streaming project scaffolder for myself, but not only. Supports hundreds of template engines through the @JSTransformers API or if you want custom `render` function passed through options

12 lines (9 loc) 218 B
const path = require('path'); const EXTRE = /^[.]?[^.]+([.].*)$/; module.exports = function (input) { var extension = EXTRE.exec(path.basename(input)); if (!extension) { return; } return extension[1]; };