Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

import-meta-resolve

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

import-meta-resolve - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

8

lib/resolve.d.ts

@@ -13,4 +13,4 @@ /// <reference types="node" />

* @param {URL} base
* @param {Set<string>} conditions
* @param {boolean} preserveSymlinks
* @param {Set<string>} [conditions]
* @param {boolean} [preserveSymlinks]
* @returns {URL}

@@ -21,4 +21,4 @@ */

base: URL,
conditions: Set<string>,
preserveSymlinks: boolean
conditions?: Set<string> | undefined,
preserveSymlinks?: boolean | undefined
): URL

@@ -25,0 +25,0 @@ /**

@@ -320,3 +320,3 @@ // Manually “tree shaken” from:

* @param {URL} base
* @param {boolean} preserveSymlinks
* @param {boolean} [preserveSymlinks]
* @returns {URL}

@@ -1102,4 +1102,4 @@ */

* @param {URL} base
* @param {Set<string>} conditions
* @param {boolean} preserveSymlinks
* @param {Set<string>} [conditions]
* @param {boolean} [preserveSymlinks]
* @returns {URL}

@@ -1106,0 +1106,0 @@ */

{
"name": "import-meta-resolve",
"version": "2.0.1",
"version": "2.0.2",
"description": "Resolve things like Node.js — ponyfill for `import.meta.resolve`",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -51,25 +51,21 @@ # import-meta-resolve

main()
// A file:
console.log(await resolve('./index.js', import.meta.url))
//=> file:///Users/tilde/Projects/oss/import-meta-resolve/index.js
async function main() {
// A file:
console.log(await resolve('./index.js', import.meta.url))
//=> file:///Users/tilde/Projects/oss/import-meta-resolve/index.js
// A CJS package:
console.log(await resolve('builtins', import.meta.url))
//=> file:///Users/tilde/Projects/oss/import-meta-resolve/node_modules/builtins/index.js
// A CJS package:
console.log(await resolve('builtins', import.meta.url))
//=> file:///Users/tilde/Projects/oss/import-meta-resolve/node_modules/builtins/index.js
// A scoped CJS package:
console.log(await resolve('@eslint/eslintrc', import.meta.url))
//=> file:///Users/tilde/Projects/oss/import-meta-resolve/node_modules/@eslint/eslintrc/lib/index.js
// A scoped CJS package:
console.log(await resolve('@eslint/eslintrc', import.meta.url))
//=> file:///Users/tilde/Projects/oss/import-meta-resolve/node_modules/@eslint/eslintrc/lib/index.js
// A package with an export map:
console.log(await resolve('tape/lib/test', import.meta.url))
//=> file:///Users/tilde/Projects/oss/import-meta-resolve/node_modules/tape/lib/test.js
// A package with an export map:
console.log(await resolve('tape/lib/test', import.meta.url))
//=> file:///Users/tilde/Projects/oss/import-meta-resolve/node_modules/tape/lib/test.js
// A node builtin:
console.log(await resolve('fs', import.meta.url))
//=> node:fs
}
// A node builtin:
console.log(await resolve('fs', import.meta.url))
//=> node:fs
```

@@ -76,0 +72,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc