Licence
MIT
Version
1.0.9
Deps
1
Size
413 kB
Vulns
0
Weekly
485
layer-esm
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 --saveOf 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 iDevelopment:
npm run devBuild:
npm run buildTest:
npm testSingle test file:
npm test -- test/layer.test.jsDocumentation:
npm run docsDocker:
docker compose up -d --buildVisit: http://localhost:8080
License
This software is released under the terms of the MIT license.