Gathering detailed insights and metrics for interpret
Gathering detailed insights and metrics for interpret
Gathering detailed insights and metrics for interpret
Gathering detailed insights and metrics for interpret
A dictionary of file extensions and associated module loaders.
npm install interpret
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (100%)
Total Downloads
5,266,725,252
Last Day
4,151,112
Last Week
22,235,510
Last Month
95,339,868
Last Year
1,040,124,487
MIT License
260 Stars
168 Commits
48 Forks
9 Watchers
3 Branches
29 Contributors
Updated on Mar 14, 2025
Latest Version
3.1.1
Package Id
interpret@3.1.1
Unpacked Size
20.96 kB
Size
4.75 kB
File Count
6
NPM Version
8.11.0
Node Version
16.14.2
Cumulative downloads
Total Downloads
Last Day
46.7%
4,151,112
Compared to previous day
Last Week
4.8%
22,235,510
Compared to previous week
Last Month
-3.2%
95,339,868
Compared to previous month
Last Year
4%
1,040,124,487
Compared to previous year
A dictionary of file extensions and associated module loaders.
This is used by Liftoff to automatically require dependencies for configuration files, and by rechoir for registering module loaders.
Consumers should use the exported extensions
or jsVariants
object to determine which module should be loaded for a given extension. If a matching extension is found, consumers should do the following:
module
property. If successful, the register
property (a function) should be called with the module passed as the first argument. Advanced: An optional second argument can be provided to replace the default configuration for a hook.This module provides two top-level properties: extensions
and jsVariants
.
Note: This module does not depend on any of the loaders it recommends; instead, end-users are expected to install the hooks they want to use for the file types they want to use. See supported extensions and their hooks in the sections below.
extensions
A mapping of file extensions to modules which provide a require.extensions loader.
File extension keys are all in the format of '.foo'
or '.foo.bar'
and module loader values are either null
if the loader should fallthrough to node's loader,
or a string representing the module to be required, an object of { module: 'foobar', register: function }
, or an array containing those strings and/or objects.
A sample of an entry containing multiple hooks would look like:
1{ 2 '.ts': [ 3 'ts-node/register', 4 'sucrase/register/ts', 5 { 6 module: '@babel/register', 7 register: function(hook) { 8 hook({ 9 extensions: '.ts', 10 rootMode: 'upward-optional', 11 ignore: [ignoreNonBabelAndNodeModules], 12 }); 13 }, 14 }, 15 ], 16}
Supported extensions and their hooks
1.babel.js: 2 - '@babel/register' 3.babel.jsx: 4 - '@babel/register' 5.babel.ts: 6 - '@babel/register' 7.babel.tsx: 8 - '@babel/register' 9.cjs: 10 - interpret/cjs-stub 11.coffee: 12 - coffeescript/register 13.coffee.md: 14 - coffeescript/register 15.cts: 16 - ts-node/register 17.esbuild.js: 18 - esbuild-register/dist/node 19.esbuild.jsx: 20 - esbuild-register/dist/node 21.esbuild.ts: 22 - esbuild-register/dist/node 23.esbuild.tsx: 24 - esbuild-register/dist/node 25.esm.js: 26 - esm 27.js: 28 - built-in node.js loader 29.json: 30 - built-in node.js loader 31.json5: 32 - json5/lib/register 33.jsx: 34 - '@babel/register' 35 - sucrase/register/jsx 36.litcoffee: 37 - coffeescript/register 38.mdx: 39 - '@mdx-js/register' 40.mjs: 41 - interpret/mjs-stub 42.node: 43 - built-in node.js loader 44.sucrase.js: 45 - sucrase/dist/register 46.sucrase.jsx: 47 - sucrase/dist/register 48.sucrase.ts: 49 - sucrase/dist/register 50.sucrase.tsx: 51 - sucrase/dist/register 52.swc.js: 53 - '@swc/register' 54.swc.jsx: 55 - '@swc/register' 56.swc.ts: 57 - '@swc/register' 58.swc.tsx: 59 - '@swc/register' 60.toml: 61 - toml-require 62.ts: 63 - ts-node/register 64 - sucrase/register/ts 65 - '@babel/register' 66 - esbuild-register/dist/node 67 - '@swc/register' 68.tsx: 69 - ts-node/register 70 - sucrase/register/tsx 71 - '@babel/register' 72 - esbuild-register/dist/node 73 - '@swc/register' 74.yaml: 75 - yaml-hook/register 76.yml: 77 - yaml-hook/register
jsVariants
The jsVariants
is the same mapping as above, but only include the extensions which are variants of JavaScript.
Supported extensions and their hooks
1.babel.js: 2 - '@babel/register' 3.babel.jsx: 4 - '@babel/register' 5.babel.ts: 6 - '@babel/register' 7.babel.tsx: 8 - '@babel/register' 9.cjs: 10 - interpret/cjs-stub 11.coffee: 12 - coffeescript/register 13.coffee.md: 14 - coffeescript/register 15.esbuild.js: 16 - esbuild-register/dist/node 17.esbuild.jsx: 18 - esbuild-register/dist/node 19.esbuild.ts: 20 - esbuild-register/dist/node 21.esbuild.tsx: 22 - esbuild-register/dist/node 23.esm.js: 24 - esm 25.js: 26 - built-in node.js loader 27.jsx: 28 - '@babel/register' 29 - sucrase/register/jsx 30.litcoffee: 31 - coffeescript/register 32.mdx: 33 - '@mdx-js/register' 34.mjs: 35 - interpret/mjs-stub 36.sucrase.js: 37 - sucrase/dist/register 38.sucrase.jsx: 39 - sucrase/dist/register 40.sucrase.ts: 41 - sucrase/dist/register 42.sucrase.tsx: 43 - sucrase/dist/register 44.swc.js: 45 - '@swc/register' 46.swc.jsx: 47 - '@swc/register' 48.swc.ts: 49 - '@swc/register' 50.swc.tsx: 51 - '@swc/register' 52.ts: 53 - ts-node/register 54 - sucrase/register/ts 55 - '@babel/register' 56 - esbuild-register/dist/node 57 - '@swc/register' 58.tsx: 59 - ts-node/register 60 - sucrase/register/tsx 61 - '@babel/register' 62 - esbuild-register/dist/node 63 - '@swc/register'
MIT
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
security policy file detected
Details
Reason
Found 3/27 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-05-05
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More