|
1 | | -> [!IMPORTANT] |
2 | | -> This library is not ready to be used yet. Please check back in a couple weeks. |
3 | | -
|
4 | | -<br><br> |
5 | | - |
6 | 1 | <div align="center" style="text-align: center;"> |
7 | 2 |
|
8 | 3 | # CoreUtils |
9 | 4 | Cross-platform, general-purpose, JavaScript core library for Node, Deno and the browser. |
10 | 5 | Intended to be used in conjunction with [`@sv443-network/userutils`](https://github.com/Sv443-Network/UserUtils) and [`@sv443-network/djsutils`](https://github.com/Sv443-Network/DJSUtils), but can be used independently as well. |
11 | 6 |
|
12 | | -### [Documentation](./docs.md#readme) • [Features](#features) • [Installation](#installation) • [License](#license) |
| 7 | +### [Documentation](./docs.md#readme) • [Features](#features) • [Installation](#installation) • [License](#license) • [Changelog](./CHANGELOG.md) |
13 | 8 |
|
14 | 9 | </div> |
15 | 10 | <br> |
@@ -138,4 +133,35 @@ pnpm i @sv443-network/coreutils |
138 | 133 | yarn add @sv443-network/coreutils |
139 | 134 | npx jsr install @sv443-network/coreutils |
140 | 135 | deno add jsr:@sv443-network/coreutils |
141 | | -``` |
| 136 | +``` |
| 137 | +- If you are in a DOM environment, you can include the UMD bundle using your favorite CDN: |
| 138 | +```html |
| 139 | +<script src="https://cdn.jsdelivr.net/npm/@sv443-network/coreutils@latest/dist/CoreUtils.min.umd.js"></script> |
| 140 | +<script src="https://unpkg.com/@sv443-network/coreutils@latest/dist/CoreUtils.min.umd.js"></script> |
| 141 | +<script src="https://esm.sh/@sv443-network/coreutils@latest/dist/CoreUtils.min.umd.js"></script> |
| 142 | +``` |
| 143 | +- Then, import parts of the library as needed: |
| 144 | +```ts |
| 145 | +// >> EcmaScript Modules (ESM): |
| 146 | + |
| 147 | +// - import parts of the library: |
| 148 | +import { randomItem } from "@sv443-network/coreutils"; |
| 149 | +// - or import the full library: |
| 150 | +import * as CoreUtils from "@sv443-network/coreutils"; |
| 151 | +// - or import raw TS files, after installing via JSR: |
| 152 | +import { DataStore } from "jsr:@sv443-network/coreutils/lib/DataStore.ts"; |
| 153 | + |
| 154 | +// >> CommonJS (CJS): |
| 155 | + |
| 156 | +// - import parts of the library: |
| 157 | +const { debounce } = require("@sv443-network/coreutils"); |
| 158 | +// - or import the full library: |
| 159 | +const CoreUtils = require("@sv443-network/coreutils"); |
| 160 | + |
| 161 | +// >> Universal Module Definition (UMD): |
| 162 | + |
| 163 | +// - to make the global variable `CoreUtils` available, import this file: |
| 164 | +// "@sv443-network/coreutils/dist/CoreUtils.min.umd.js" |
| 165 | +// - or import the library on your HTML page: |
| 166 | +// <script src="https://cdn.jsdelivr.net/npm/@sv443-network/coreutils@latest/dist/CoreUtils.min.umd.js"></script> |
| 167 | +``` |
0 commit comments