UNPKG
indexifier
Version:
latest (3.3.0)
3.3.0
3.2.2
3.2.1
3.2.0
3.1.1
3.1.0
3.0.1
3.0.0
2.0.0
1.0.0
Generate an index from a directory
github.com/joscha/indexifier
joscha/indexifier
indexifier
/
wrapHref.js
7 lines
(5 loc)
•
197 B
JavaScript
View Raw
1
2
3
4
5
6
7
const
path =
require
(
'path'
);
module
.
exports
=
function
wrapHref
(
node, cwd
) {
const
relativePath = path.
relative
(cwd, node.
path
);
return
`<a href="./
${relativePath}
">
${node.name}
</a>`
; };