Comparing version 0.4.1 to 0.4.2
@@ -100,4 +100,4 @@ "use strict"; | ||
const requireSnippet = require2 == null ? "" : ` | ||
import { createRequire } from "node:module"; | ||
const ${_M_} = createRequire(import.meta.url)("${require2}"); | ||
import _M_node_module from "node:module"; | ||
const ${_M_} = _M_node_module.createRequire(import.meta.url)("${require2}"); | ||
`.trim(); | ||
@@ -104,0 +104,0 @@ !members.includes("default") && members.push("default"); |
{ | ||
"name": "lib-esm", | ||
"version": "0.4.1", | ||
"description": "Lib to ESM snippet.", | ||
"version": "0.4.2", | ||
"description": "A tiny `esm` snippets interop lib", | ||
"main": "./dist/index.js", | ||
@@ -16,3 +16,3 @@ "types": "./dist/index.d.ts", | ||
"repository": "https://github.com/caoxiemeihao/lib-esm.git", | ||
"author": "草鞋没号 <308487730@qq.com>", | ||
"author": "Leo Wang(草鞋没号) <308487730@qq.com>", | ||
"license": "MIT", | ||
@@ -19,0 +19,0 @@ "scripts": { |
# lib-esm | ||
Lib to ESM snippet. | ||
A tiny `esm` snippets interop lib. | ||
@@ -21,3 +21,3 @@ [![NPM version](https://img.shields.io/npm/v/lib-esm.svg)](https://npmjs.org/package/lib-esm) | ||
const result = libEsm({ | ||
const snippets = libEsm({ | ||
window: 'lib-name', | ||
@@ -31,7 +31,7 @@ require: 'lib-name', | ||
console.log(`${result.window}\n${result.exports}`) | ||
console.log(`${result.require}\n${result.exports}`) | ||
console.log(`${snippets.window}\n${snippets.exports}`) | ||
console.log(`${snippets.require}\n${snippets.exports}`) | ||
``` | ||
**result.window** | ||
**snippets.window** | ||
@@ -42,10 +42,10 @@ ```js | ||
**result.require** | ||
**snippets.require** | ||
```js | ||
import { createRequire } from "node:module"; | ||
const _M_ = createRequire(import.meta.url)("lib-name"); | ||
import _M_node_module from "node:module"; | ||
const _M_ = _M_node_module.createRequire(import.meta.url)("lib-name"); | ||
``` | ||
**result.exports** | ||
**snippets.exports** | ||
@@ -52,0 +52,0 @@ ```js |
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
10307