Security News
JavaScript Leaders Demand Oracle Release the JavaScript Trademark
In an open letter, JavaScript community leaders urge Oracle to give up the JavaScript trademark, arguing that it has been effectively abandoned through nonuse.
Lib to ESM snippet.
npm i lib-esm
import libEsm from 'lib-esm'
// or
// const libEsm = require('lib-esm')
const result = libEsm({
window: 'lib-name',
require: 'lib-name',
exports: [
'foo',
'bar',
],
})
console.log(`${result.window}\n${result.exports}`)
console.log(`${result.require}\n${result.exports}`)
result.window
const _M_ = window["lib-name"];
result.require
import { createRequire } from "node:module";
const _M_ = createRequire(import.meta.url)("lib-name");
result.exports
export const foo = _M_.foo;
export const bar = _M_.bar;
const keyword_default = _M_.default || _M_;
export {
keyword_default as default,
};
/** Lib to ESM code snippet. */
function libEsm(options: {
/**
* IIFE name
*/
window?: string;
/**
* require id
*/
require?: string;
/**
* export members
*/
exports?: string[];
/**
* Prevent name conflicts
*/
conflict?: string;
}): {
/** `window[iife-name]` snippets. */
window: string;
/** `require(id)` snippets. */
require: string;
/** `export` snippets. */
exports: string;
/** Keywords alias */
keywords: Record<string, string>;
}
FAQs
A tiny `esm` snippets interop lib
The npm package lib-esm receives a total of 6,481 weekly downloads. As such, lib-esm popularity was classified as popular.
We found that lib-esm demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
In an open letter, JavaScript community leaders urge Oracle to give up the JavaScript trademark, arguing that it has been effectively abandoned through nonuse.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.