Skip to content

Instantly share code, notes, and snippets.

View wangrongding's full-sized avatar

荣顶 wangrongding

View GitHub Profile
wangrongding / bookmarks
Last active March 11, 2022 06:38
chrome bookmarks backup
View bookmarks
<!DOCTYPE NETSCAPE-Bookmark-file-1>
<!-- This is an automatically generated file.
It will be read and overwritten.
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<DT><H3 ADD_DATE="1620879001" LAST_MODIFIED="1646978437" PERSONAL_TOOLBAR_FOLDER="true">书签栏</H3>
sindresorhus /
Last active December 11, 2023 03:13
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
View index.html
<!DOCTYPE html>
<p id="greeting"></p>
<script type="module">
import {Runtime, Inspector, Library} from "";
import notebook from "";
// Rewrite the notebook to redefine the “subject” cell in the main module.
const override = {
adamreisnz / package.json
Last active October 18, 2023 01:42
Simple pure npm scripts build process
View package.json
"name": "project-name",
"description": "Template for static sites",
"version": "1.0.0",
"homepage": "",
"author": {
"name": "Adam Reis",
"url": ""
"license": "UNLICENSED",