|
| 1 | +# @terminal-nerds/snippets-package |
| 2 | + |
| 3 | +![package version badge] |
| 4 | +[![dependencies badge]][dependencies url]\ |
| 5 | +[![install size badge]][install size url] |
| 6 | + |
| 7 | +➡️ **This package wraps all available modules with snippets related to [package]** |
| 8 | +— part of the [terminal-nerds/snippets] project. |
| 9 | + |
| 10 | +[package]: https://docs.npmjs.com/cli/v9/configuring-npm/package-json |
| 11 | +[terminal-nerds/snippets]: https://github.com/terminal-nerds/snippets |
| 12 | +[package version badge]: https://img.shields.io/npm/v/@terminal-nerds/snippets-package/latest?style=for-the-badge&logo=npm |
| 13 | +[dependencies badge]: https://img.shields.io/librariesio/release/npm/@terminal-nerds/snippets-package?style=for-the-badge |
| 14 | +[dependencies url]: https://libraries.io/npm/@terminal-nerds%2snippets-package |
| 15 | +[install size badge]: https://packagephobia.com/badge?p=@terminal-nerds/snippets-package |
| 16 | +[install size url]: https://packagephobia.com/result?p=@terminal-nerds/snippets-package |
| 17 | + |
| 18 | +## Modules included |
| 19 | + |
| 20 | +[![documentation badge]][documentation url] |
| 21 | + |
| 22 | +[documentation badge]: https://img.shields.io/static/v1?color=informational&style=for-the-badge&label=documentation&message=jsdocs.io |
| 23 | +[documentation url]: https://jsdocs.io/package/@terminal-nerds/snippets-package |
| 24 | + |
| 25 | +<!-- prettier-sort-markdown-table --> |
| 26 | + |
| 27 | +| Name | Size | |
| 28 | +| ------------------------------------------------- | ----------------------------------------------------------------- | |
| 29 | +| [`@terminal-nerds/snippets-package/dependencies`] | ![dependencies size gzip badge] ![dependencies size brotli badge] | |
| 30 | +| [`@terminal-nerds/snippets-package/json`] | ![json size gzip badge] ![json size brotli badge] | |
| 31 | +| [`@terminal-nerds/snippets-package/schema`] | ![schema size gzip badge] ![schema size brotli badge] | |
| 32 | + |
| 33 | +<!-- prettier-ignore-start --> |
| 34 | +<!-- MODULES LINKS --> |
| 35 | +[`@terminal-nerds/snippets-package/dependencies`]: https://github.com/terminal-nerds/snippets/blob/main/packages/package/source/dependencies/dependencies.ts |
| 36 | +[dependencies size gzip badge]: https://badgen.net/badgesize/gzip/file-url/unpkg.com/@terminal-nerds/snippets-package/dist/dependencies/dependencies.js?label=gzip |
| 37 | +[dependencies size brotli badge]: https://badgen.net/badgesize/brotli/file-url/unpkg.com/@terminal-nerds/snippets-package/dist/dependencies/dependencies.js?label=brotli |
| 38 | + |
| 39 | +[`@terminal-nerds/snippets-package/json`]: https://github.com/terminal-nerds/snippets/blob/main/packages/package/source/json/json.ts |
| 40 | +[json size gzip badge]: https://badgen.net/badgesize/gzip/file-url/unpkg.com/@terminal-nerds/snippets-package/dist/json/json.js?label=gzip |
| 41 | +[json size brotli badge]: https://badgen.net/badgesize/brotli/file-url/unpkg.com/@terminal-nerds/snippets-package/dist/json/json.js?label=brotli |
| 42 | + |
| 43 | +[`@terminal-nerds/snippets-package/schema`]: https://github.com/terminal-nerds/snippets/blob/main/packages/package/source/schema/schema.ts |
| 44 | +[schema size gzip badge]: https://badgen.net/badgesize/gzip/file-url/unpkg.com/@terminal-nerds/snippets-package/dist/schema/schema.js?label=gzip |
| 45 | +[schema size brotli badge]: https://badgen.net/badgesize/brotli/file-url/unpkg.com/@terminal-nerds/snippets-package/dist/schema/schema.js?label=brotli |
| 46 | +<!-- prettier-ignore-end --> |
| 47 | + |
| 48 | +--- |
| 49 | + |
| 50 | +## Prerequisites & usage |
| 51 | + |
| 52 | +### Optional |
| 53 | + |
| 54 | +[![supported typescript version badge]][typescript] |
| 55 | + |
| 56 | +[typescript]: https://typescriptlang.org/ |
| 57 | +[typescript icon]: https://api.iconify.design/logos/typescript-icon.svg |
| 58 | +[supported typescript version badge]: https://img.shields.io/github/package-json/dependency-version/terminal-nerds/snippets/peer/typescript?filename=packages%2Ftypescript%2Fpackage.json&logo=typescript&style=for-the-badge&label=typescript |
| 59 | + |
| 60 | +If you are using ![typescript icon] [TypeScript], |
| 61 | +the latest version, which supports new features _(such as `satisfies`)_, is supported. |
| 62 | + |
| 63 | +### Runtime environments |
| 64 | + |
| 65 | +This package can be used in several runtime environments. |
| 66 | +We aim for cross-runtime compatibility and ensure proper error messages |
| 67 | +if a particular snippet cannot be run in the currently running environment. |
| 68 | + |
| 69 | +#### Browsers |
| 70 | + |
| 71 | +We use [browserslist] to define the minimum browsers versions supported.\ |
| 72 | +Take a look at our [shared browserslist configuration] for more details. |
| 73 | + |
| 74 | +[browserslist]: https://github.com/browserslist/browserslist |
| 75 | +[shared browserslist configuration]: https://github.com/terminal-nerds/configs/blob/main/packages/browserslist/source/browsers.ts |
| 76 | + |
| 77 | +**Usage**: |
| 78 | + |
| 79 | +```html |
| 80 | +<script type="module"> |
| 81 | + import { snippet } from "https://cdn.jsdelivr.net/npm/@terminal-nerds/snippets-package"; |
| 82 | +</script> |
| 83 | +``` |
| 84 | + |
| 85 | +--- |
| 86 | + |
| 87 | +#### Bun |
| 88 | + |
| 89 | +We aim to support the latest version of ![bun icon] [bun]. |
| 90 | + |
| 91 | +**Usage**: |
| 92 | + |
| 93 | +Firstly, install it: |
| 94 | + |
| 95 | +```sh |
| 96 | +bun add @terminal-nerds/snippets-package |
| 97 | +``` |
| 98 | + |
| 99 | +And then in a particular file: |
| 100 | + |
| 101 | +```js |
| 102 | +import { snippet } from "@terminal-nerds/snippets-package"; |
| 103 | +``` |
| 104 | + |
| 105 | +[bun]: https://bun.sh/ |
| 106 | +[bun icon]: https://api.iconify.design/logos/bun.svg |
| 107 | + |
| 108 | +--- |
| 109 | + |
| 110 | +#### Deno |
| 111 | + |
| 112 | +We aim to support the latest version of ![deno icon] [Deno]. |
| 113 | + |
| 114 | +**Usage**: |
| 115 | + |
| 116 | +```ts |
| 117 | +import { snippet } from "npm:@terminal-nerds/snippets-package"; |
| 118 | +``` |
| 119 | + |
| 120 | +[deno]: https://deno.land/ |
| 121 | +[deno icon]: https://api.iconify.design/logos/deno.svg |
| 122 | + |
| 123 | +--- |
| 124 | + |
| 125 | +#### Node.js |
| 126 | + |
| 127 | +[![node.js version support badge]][node.js] |
| 128 | + |
| 129 | +The latest ![node.js icon] [Node.js] LTS _(Long-Term Support)_ version is the minimum one supported. |
| 130 | + |
| 131 | +> **Warning**\ |
| 132 | +> **This package is written in [ES Module] _(ESM)_ type.**\ |
| 133 | +> So, if you wish to use it in a project with CommonJS (CJS) type, you need to bundle this package or a particular module(s). |
| 134 | +
|
| 135 | +**Usage**: |
| 136 | + |
| 137 | +Install it first with the Node.js package manager of your choice. In our example, we use [pnpm]. |
| 138 | + |
| 139 | +```sh |
| 140 | +pnpm add @terminal-nerds/snippets-package |
| 141 | +``` |
| 142 | + |
| 143 | +And then in a particular file: |
| 144 | + |
| 145 | +```js |
| 146 | +import { snippet } from "@terminal-nerds/snippets-package"; |
| 147 | +``` |
| 148 | + |
| 149 | +[ES Module]: https://www.freecodecamp.org/news/javascript-es-modules-and-module-bundlers |
| 150 | +[pnpm]: https://pnpm.io |
| 151 | +[node.js]: https://nodejs.org/en/ |
| 152 | +[node.js icon]: https://api.iconify.design/logos/nodejs-icon.svg |
| 153 | +[node.js version support badge]: https://img.shields.io/node/v-lts/@terminal-nerds/snippets?style=for-the-badge&logo=nodedotjs |
| 154 | + |
| 155 | +--- |
| 156 | + |
| 157 | +## Security |
| 158 | + |
| 159 | +[![workflow security badge]][security policy] |
| 160 | + |
| 161 | +🔐 For more information, please refer to the [Security section] at the root of |
| 162 | +the [terminal-nerds/snippets] monorepo. |
| 163 | + |
| 164 | +[workflow security badge]: https://img.shields.io/github/actions/workflow/status/terminal-nerds/snippets/maintenance.yml?label=Security&logo=github&style=for-the-badge&branch=main |
| 165 | +[security section]: https://github.com/terminal-nerds/snippets#security |
| 166 | +[security policy]: https://github.com/terminal-nerds/snippets/security/policy |
| 167 | + |
| 168 | +--- |
| 169 | + |
| 170 | +## License |
| 171 | + |
| 172 | +[![license badge]][license] |
| 173 | + |
| 174 | +⚖️ For more information, please refer to the [License section] at the root of the [terminal-nerds/snippets] monorepo. |
| 175 | + |
| 176 | +[license]: https://github.com/terminal-nerds/snippets/blob/main/LICENSE.md |
| 177 | +[license badge]: https://img.shields.io/github/license/terminal-nerds/snippets?style=for-the-badge |
| 178 | +[license section]: https://github.com/terminal-nerds/snippets#License |
| 179 | + |
| 180 | +### Contributing |
| 181 | + |
| 182 | +[![contributors badge]][contributors url] |
| 183 | + |
| 184 | +🤝 **Contributions of any kind are welcome!** |
| 185 | + |
| 186 | +Please refer to the monorepo _([terminal-nerds/snippets])_ project's [CONTRIBUTING file] for more information |
| 187 | +if you wish to get involved. |
| 188 | + |
| 189 | +[contributing file]: https://github.com/terminal-nerds/snippets/blob/main/.github/CONTRIBUTING.md |
| 190 | +[contributors badge]: https://img.shields.io/github/contributors/terminal-nerds/snippets?style=for-the-badge |
| 191 | +[contributors url]: https://github.com/terminal-nerds/snippets#contributors |
| 192 | + |
| 193 | +### Author |
| 194 | + |
| 195 | +🎉 The idea of this project was initiated by [xeho91]. However, it's the [contributors] who matter the most. |
| 196 | + |
| 197 | +[contributors]: https://github.com/terminal-nerds/snippets/blob/main/README.md#project-contributors |
| 198 | +[xeho91]: https://github.com/xeho91 |
0 commit comments