You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
path.js:39
throw new ERR_INVALID_ARG_TYPE('path', 'string', path);
^
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type
at assertPath (path.js:39:11)
I'm afraid the programmatic usage docs haven't got much attention. PRs welcome 😉.
As you discovered, cwd is required. It should probably default to './' - I think this could be considered a bug.
With the fileName thing - I think what you might want to do is this:
constfile=fs.createReadStream(fileName);file.fileName=fileName// set fileName so hashmark knows what file this ishashmark(file,{length: 8,digest: 'md5',pattern: '{hash}',cwd: './'}).on('file',(oldN,newN)=>console.log(newN)).on('end',(jsonMap)=>console.log(jsonMap));
Alternatively you can pass a file name and hashmark will do the createReadStream step for you:
I'm trying to use this tool programatically, but I'm getting errors
I get the following error:
I can however fix this by adding the
cwd
optionbut I cannot find any documentation about this, so I'm wondering if there is an other problem here?
Furthermore, the
jsonMap
contains the followingIt is always
<anonymouse>
, and the reason behind this isfile.fileName === '<anonymouse>'
and is used here. Is this a bug?The text was updated successfully, but these errors were encountered: