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

15 lines (12 loc) 353 B
'use strict'; var path = require('path'); var findUp = require('find-up'); module.exports = function (cwd) { return findUp('package.json', {cwd: cwd}).then(function (fp) { return fp ? path.dirname(fp) : null; }); }; module.exports.sync = function (cwd) { var fp = findUp.sync('package.json', {cwd: cwd}); return fp ? path.dirname(fp) : null; };