
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
@jspm/resolve
Advanced tools
This implements the jspm_packages/[registry]/[name]@[version]/ module resolution lookup while checking the rules defined in package.json and json.json for jspm.
For the full detailed specification of jspm resolution, see the jspm 2.0 resolver specification.
The resolver is fully backwards-compatible with the Node.js --experimental-modules resolver, which in turn is fully-backwards compatible with the traditional CommonJS resolver.
Install with:
npm install @jspm/resolve
Then basic usage is:
import jspmResolve from '@jspm/resolve';
const { resolved, format } = await jspmResolve('specifier', '/path/to/parent/module.js');
The jspm resolver works on file paths that are /-separated. It will still correctly handle the URL normalization rules of the ES Module resolver though, but works on file paths for convenience and performance.
Format, like the Node.js --experimental-modules resolver, is one of commonjs, module, json, builtin, addon or unknown for asset files.
A cache object can be passed to the resolution function that will maintain all the lookup state for fast resolution:
const cache = {};
jspmResolve(name, parent, { cache });
A custom environment can be provided to jspmResolve, representing the conditional paths to take in the resolver.
The default environment is the Node.js development environment:
{
browser: false,
node: true,
production: false,
dev: true,
'react-native': false,
electron: false,
deno: false,
default: true
}
So a browser production resolution can be made with eg:
jspmResolve(name, parent, {
env: {
browser: true,
production: true
}
});
The browser main and map will then be respected, as well as any custom production mappings.
By default the jspm resolver assumes resolution is coming from an ES module context.
CommonJS modules in Node.js always load all dependencies as CommonJS and this can also be supported in the jspm resolve options by passing the cjsResolve: true option.
This then implements automatic file extension searching as well as always loading the CommonJS format if not an addon or json path.
jspmResolve.sync can be used to perform synchronous resolution, with an otherwise identical API.
A loader.mjs file is provided which supports the Node.js --experimental-modules loader API:
node --experimental-modules --loader @jspm/resolve/loader.mjs x.js
This applies the jspm resolution to Node.js.
Apache 2.0
FAQs
jspm 2.0 resolver
The npm package @jspm/resolve receives a total of 94 weekly downloads. As such, @jspm/resolve popularity was classified as not popular.
We found that @jspm/resolve demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.