import-meta-resolve
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "import-meta-resolve", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Resolve things like Node.js — ponyfill for `import.meta.resolve`", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -26,2 +26,22 @@ # import-meta-resolve | ||
import {resolve} from 'import-meta-resolve' | ||
main() | ||
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 scoped CJS package: | ||
console.log(await resolve('@babel/core', import.meta.url)) | ||
//=> file:///Users/tilde/Projects/oss/import-meta-resolve/node_modules/@babel/core/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 | ||
} | ||
``` | ||
@@ -28,0 +48,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
49972
126
0