https://github.com/chengchuu/layer-esm
Modern ESM Layer Library for Web Popups and Dialogs
https://github.com/chengchuu/layer-esm
dialog esm layer library popup
Last synced: 7 days ago
JSON representation
Modern ESM Layer Library for Web Popups and Dialogs
- Host: GitHub
- URL: https://github.com/chengchuu/layer-esm
- Owner: chengchuu
- License: mit
- Created: 2026-06-21T09:12:06.000Z (17 days ago)
- Default Branch: main
- Last Pushed: 2026-06-28T13:36:18.000Z (10 days ago)
- Last Synced: 2026-06-28T14:14:49.895Z (10 days ago)
- Topics: dialog, esm, layer, library, popup
- Language: TypeScript
- Homepage:
- Size: 89.8 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# layer-esm
[![npm version][npm-image]][npm-url]
[![l][l-image]][l-url]
[npm-image]: https://img.shields.io/npm/v/layer-esm
[npm-url]: https://npmjs.org/package/layer-esm
[l-image]: https://img.shields.io/npm/l/layer-esm
[l-url]: https://github.com/chengchuu/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](https://www.npmjs.com/package/layer-esm).
```bash
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
```javascript
import { close, confirm, load, msg } from "layer-esm";
const loadingIndex = load();
confirm("Continue?", {}, () => {
msg("Confirmed");
close(loadingIndex);
});
```
## Guides
- [Introducing layer-esm](./release-notes/introducing-layer-esm-v1.0.1.md)
- [Release notes index](./release-notes/README.md)
## Contributing
### Development Environment
| Dependency | Version |
|------------|----------|
| Node.js | v22.21.1 |
| TypeScript | v5.1.6 |
### Scripts
Install Dependencies:
```bash
npm i
```
Development:
```bash
npm run dev
```
Build:
```bash
npm run build
```
Test:
```bash
npm test
```
Single test file:
```bash
npm test -- test/layer.test.js
```
Documentation:
```bash
npm run docs
```
Docker:
```bash
docker compose up -d --build
```
Visit:
## License
This software is released under the terms of the [MIT license](https://github.com/chengchuu/layer-esm/blob/main/LICENSE).