npm.io
1.0.9 • Published 6h ago

layer-esm

Licence
MIT
Version
1.0.9
Deps
1
Size
413 kB
Vulns
0
Weekly
485

layer-esm

npm version l

Special thanks to 贤心, the original author of Layer, for creating a popup library that has been widely used across the web community for many years. layer-esm is a modern ESM adaptation and refactoring effort inspired by the original Layer project.

Install

Use layer-esm via npm.

npm install layer-esm --save

Of course, you can also serve the built package files yourself. The ESM, CommonJS, and type declaration outputs are written to dist/.

Usage

import { close, confirm, load, msg } from "layer-esm";

const loadingIndex = load();

confirm("Continue?", {}, () => {
  msg("Confirmed");
  close(loadingIndex);
});

Guides

Contributing

Development Environment
Dependency Version
Node.js v22.21.1
TypeScript v5.1.6
Scripts

Install Dependencies:

npm i

Development:

npm run dev

Build:

npm run build

Test:

npm test

Single test file:

npm test -- test/layer.test.js

Documentation:

npm run docs

Docker:

docker compose up -d --build

Visit: http://localhost:8080

License

This software is released under the terms of the MIT license.

Keywords