Comparing version 0.1.6 to 0.1.7
@@ -5,2 +5,4 @@ # Changelog | ||
### [0.1.7](https://github.com/unjs/mlly/compare/v0.1.6...v0.1.7) (2021-07-23) | ||
### [0.1.6](https://github.com/unjs/mlly/compare/v0.1.5...v0.1.6) (2021-07-23) | ||
@@ -7,0 +9,0 @@ |
@@ -21,3 +21,3 @@ // CommonJS | ||
export function resolvePathSync (id: string, opts: ResolveOptions) : string | ||
export function createResolve (defaults: ResolveOptions) : (id: string, from: string | URL) => Promise<string> | ||
export function createResolve (defaults: ResolveOptions) : (id: string, url: string | URL) => Promise<string> | ||
export function resolveImports (code: string, opts: ResolveOptions) : Promise<string> | ||
@@ -24,0 +24,0 @@ |
{ | ||
"name": "mlly", | ||
"version": "0.1.6", | ||
"version": "0.1.7", | ||
"description": "Missing ECMAScript module utils for Node.js", | ||
@@ -5,0 +5,0 @@ "repository": "unjs/mlly", |
@@ -51,3 +51,3 @@ # 🤝 mlly | ||
// file:///home/user/project/module.mjs | ||
console.log(await resolve('./module.mjs', { from: import.meta.url })) | ||
console.log(await resolve('./module.mjs', { url: import.meta.url })) | ||
``` | ||
@@ -69,3 +69,3 @@ | ||
// //home/user/project/module.mjs | ||
console.log(await resolvePath('./module.mjs', { from: import.meta.url })) | ||
console.log(await resolvePath('./module.mjs', { url: import.meta.url })) | ||
``` | ||
@@ -80,3 +80,3 @@ | ||
const _resolve = createResolve({ from: import.meta.url }) | ||
const _resolve = createResolve({ url: import.meta.url }) | ||
@@ -92,3 +92,3 @@ // file:///home/user/project/module.mjs | ||
import.meta.resolve = createResolve({ from: import.meta.url }) | ||
import.meta.resolve = createResolve({ url: import.meta.url }) | ||
``` | ||
@@ -104,3 +104,3 @@ | ||
// import foo from 'file:///home/user/project/bar.mjs' | ||
console.log(await resolveImports(`import foo from './bar.mjs'`, { from: import.meta.url })) | ||
console.log(await resolveImports(`import foo from './bar.mjs'`, { url: import.meta.url })) | ||
``` | ||
@@ -122,3 +122,3 @@ | ||
console.log(reverse('!emosewa si sj')) | ||
`, { from: import.meta.url }) | ||
`, { url: import.meta.url }) | ||
``` | ||
@@ -138,3 +138,3 @@ | ||
await loadModule('./hello.mjs', { from: import.meta.url }) | ||
await loadModule('./hello.mjs', { url: import.meta.url }) | ||
``` | ||
@@ -191,3 +191,3 @@ | ||
const url = await resolve('./index.mjs', { from: import.meta.url }) | ||
const url = await resolve('./index.mjs', { url: import.meta.url }) | ||
console.log(await loadURL(url)) | ||
@@ -194,0 +194,0 @@ ``` |
Sorry, the diff of this file is not supported yet
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
15076
202