squanlib 1.0.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +50 -1
- package/dist/squanlib.umd.js +1807 -0
- package/dist/squanlib.umd.min.js +2 -0
- package/package.json +19 -5
- package/squanlib.js +846 -98
package/README.md
CHANGED
|
@@ -1,2 +1,51 @@
|
|
|
1
1
|
# squan-lib
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
master library for squan utilities!!
|
|
4
|
+
|
|
5
|
+
## Install (npm)
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm install squanlib
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
import SquanLib from 'squanlib';
|
|
13
|
+
|
|
14
|
+
const sq = new SquanLib();
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Use from a CDN
|
|
18
|
+
|
|
19
|
+
### ES module (jsDelivr / unpkg)
|
|
20
|
+
|
|
21
|
+
```html
|
|
22
|
+
<script type="module">
|
|
23
|
+
import SquanLib from 'https://cdn.jsdelivr.net/npm/squanlib/+esm';
|
|
24
|
+
const sq = new SquanLib();
|
|
25
|
+
</script>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Plain `<script>` global
|
|
29
|
+
|
|
30
|
+
The browser build exposes the class as `window.squanlib`:
|
|
31
|
+
|
|
32
|
+
```html
|
|
33
|
+
<script src="https://cdn.jsdelivr.net/npm/squanlib/dist/squanlib.umd.min.js"></script>
|
|
34
|
+
<script>
|
|
35
|
+
const sq = new squanlib();
|
|
36
|
+
</script>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
unpkg works the same way: `https://unpkg.com/squanlib/dist/squanlib.umd.min.js`.
|
|
40
|
+
Pin a version for production, e.g. `squanlib@1.0.0`.
|
|
41
|
+
|
|
42
|
+
## Build
|
|
43
|
+
|
|
44
|
+
The browser bundles in `dist/` are generated from `squanlib.js`:
|
|
45
|
+
|
|
46
|
+
```sh
|
|
47
|
+
npm run build
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
This runs automatically before `npm publish` (`prepublishOnly`), so the CDN
|
|
51
|
+
always serves a build matching the published source.
|