UNPKG
metalsmith-hammer
Version:
latest (0.2.0)
0.2.0
0.1.0
Command-line goodness for metalsmith users
metalsmith-hammer
/
lib
/
helpers
/
get-root.js
10 lines
(7 loc)
•
228 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
var
cd =
require
(
'shelljs'
).
cd
;
var
exec =
require
(
'shelljs'
).
exec
;
var
path =
require
(
'path'
);
module
.
exports
=
function
(
) {
cd
(process.
cwd
());
return
path.
resolve
(
exec
(
'npm root'
, {
silent
:
true
}).
toString
(),
'..'
); };