Download scripts/node_modules/json5/lib/register.js from techprotrade/annator: direct link, hf CLI and curl.
- Browser
- Download file 374 Bytes
-
https://huggingface.co/techprotrade/annator/resolve/main/scripts/node_modules/json5/lib/register.js
- Command line
-
hf download hf://techprotrade/annator/scripts/node_modules/json5/lib/register.js
-
curl -L -o register.js https://huggingface.co/techprotrade/annator/resolve/main/scripts/node_modules/json5/lib/register.js
374 Bytes
| const fs = require('fs') | |
| const JSON5 = require('./') | |
| // eslint-disable-next-line node/no-deprecated-api | |
| require.extensions['.json5'] = function (module, filename) { | |
| const content = fs.readFileSync(filename, 'utf8') | |
| try { | |
| module.exports = JSON5.parse(content) | |
| } catch (err) { | |
| err.message = filename + ': ' + err.message | |
| throw err | |
| } | |
| } | |