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

lib-esm

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lib-esm - npm Package Compare versions

Comparing version 0.4.1 to 0.4.2

4

dist/index.js

@@ -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

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