Skip to content
This repository was archived by the owner on Dec 30, 2023. It is now read-only.

Commit 7f6f54f

Browse files
committed
docs: 📝 Improve packages README.md files
1 parent 2dc9462 commit 7f6f54f

File tree

5 files changed

+474
-137
lines changed

5 files changed

+474
-137
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ Reusable pieces of code, which can be **reused** across the projects.
100100
| ----------------------------- | ---------------------------------------------- |
101101
| [![snippets badge]][snippets] | [![snippets version badge]][snippets npm page] |
102102
| <!-- PACKAGES --> | <!-- PACKAGES --> |
103+
| [![function badge]][function] | [![function version badge]][function npm page] |
104+
| [![test badge]][test] | [![test version badge]][test npm page] |
103105
| [![regexp badge]][regexp] | [![regexp version badge]][regexp npm page] |
104106
| [![string badge]][string] | [![string version badge]][string npm page] |
105107

@@ -110,6 +112,16 @@ Reusable pieces of code, which can be **reused** across the projects.
110112

111113
<!-- prettier-ignore-start -->
112114
<!-- PACKAGES LINKS -->
115+
[function]: ./packages/function/README.md
116+
[function badge]: https://img.shields.io/static/v1?label=%40terminal-nerds&message=snippets-function&style=flat-square&color=informational
117+
[function version badge]: https://img.shields.io/npm/v/@terminal-nerds/snippets-function/latest?style=flat-square&logo=npm
118+
[function npm page]: https://www.npmjs.com/package/@terminal-nerds/snippets-function
119+
120+
[test]: ./packages/test/README.md
121+
[test badge]: https://img.shields.io/static/v1?label=%40terminal-nerds&message=snippets-test&style=flat-square&color=informational
122+
[test version badge]: https://img.shields.io/npm/v/@terminal-nerds/snippets-test/latest?style=flat-square&logo=npm
123+
[test npm page]: https://www.npmjs.com/package/@terminal-nerds/snippets-test
124+
113125
[regexp]: ./packages/regexp/README.md
114126
[regexp badge]: https://img.shields.io/static/v1?label=%40terminal-nerds&message=snippets-regexp&style=flat-square&color=informational
115127
[regexp version badge]: https://img.shields.io/npm/v/@terminal-nerds/snippets-regexp/latest?style=flat-square&logo=npm

packages/regexp/README.md

Lines changed: 114 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,17 @@
33
![package version badge]
44
[![size badge]][size url]
55
[![dependencies badge]][dependencies url]
6-
![types badge]
76

8-
➡️ **This package wraps all available modules with snippets related to [regexp]**
7+
➡️ **This package wraps all available modules with snippets related to [RegExp]**
98
— part of the [terminal-nerds/snippets] project.
109

11-
[terminal-nerds/snippets]: https://github.com/terminal-nerds/snippets-regexp
10+
[regexp]: https://developer.mozilla.org/en-US/docs/Glossary/RegExp
11+
[terminal-nerds/snippets]: https://github.com/terminal-nerds/snippets
1212
[package version badge]: https://img.shields.io/npm/v/@terminal-nerds/snippets-regexp/latest?style=for-the-badge&logo=npm
1313
[dependencies badge]: https://img.shields.io/librariesio/release/npm/@terminal-nerds/snippets-regexp?style=for-the-badge
1414
[dependencies url]: https://libraries.io/npm/@terminal-nerds%2snippets-regexp
1515
[size badge]: https://img.shields.io/bundlephobia/minzip/@terminal-nerds/snippets-regexp?style=for-the-badge&label=size
1616
[size url]: https://packagephobia.com/result?p=@terminal-nerds/snippets-regexp
17-
[types badge]: https://img.shields.io/npm/types/@terminal-nerds/snippets-regexp?style=for-the-badge&logo=typescript
1817

1918
## Modules included
2019

@@ -33,31 +32,112 @@
3332

3433
---
3534

36-
## Prerequisites
35+
## Prerequisites & usage
36+
37+
### Optional
38+
39+
[![supported typescript version badge]][typescript]
40+
![types badge]
41+
42+
[typescript]: https://typescriptlang.org/
43+
[typescript icon]: https://api.iconify.design/logos/typescript-icon.svg
44+
[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
45+
[types badge]: https://img.shields.io/npm/types/@terminal-nerds/snippets-regexp?style=for-the-badge&logo=typescript
46+
47+
If you are using ![typescript icon] [TypeScript],
48+
the latest version, which supports new features _(such as `satisfies`)_, is supported.
49+
50+
### Runtime environments
51+
52+
This package can be used in several runtime environments.
53+
We aim for cross-runtime compatibility and ensure proper error messages
54+
if a particular snippet cannot be run in the currently running environment.
55+
56+
#### Browsers
57+
58+
We use [browserslist] to define the minimum browsers versions supported.\
59+
Take a look at our [shared browserslist configuration] for more details.
60+
61+
[browserslist]: https://github.com/browserslist/browserslist
62+
[shared browserslist configuration]: https://github.com/terminal-nerds/configs/blob/main/packages/browserslist/source/browsers.ts
63+
64+
**Usage**:
65+
66+
```html
67+
<script type="module">
68+
import { snippet } from "https://cdn.jsdelivr.net/npm/@terminal-nerds/snippets-regexp";
69+
</script>
70+
```
71+
72+
---
73+
74+
#### Bun
75+
76+
We aim to support the latest version of ![bun icon] [bun].
77+
78+
**Usage**:
79+
80+
Firstly, install it:
81+
82+
```sh
83+
bun add @terminal-nerds/snippets-regexp
84+
```
85+
86+
And then in a particular file:
87+
88+
```js
89+
import { snippet } from "@terminal-nerds/snippets-regexp";
90+
```
91+
92+
[bun]: https://bun.sh/
93+
[bun icon]: https://api.iconify.design/logos/bun.svg
94+
95+
---
96+
97+
#### Deno
98+
99+
We aim to support the latest version of ![deno icon] [Deno].
100+
101+
**Usage**:
37102

38-
> **Note** **The packages are written in ES Module _(ESM)_ type.**\
39-
> If you wish to use in project with CommonJS _(CJS)_ type, then, you need to bundle this package.
103+
```ts
104+
import { snippet } from "npm:@terminal-nerds/snippets-regexp";
105+
```
40106

41-
### Required
107+
[deno]: https://deno.land/
108+
[deno icon]: https://api.iconify.design/logos/deno.svg
109+
110+
---
111+
112+
#### Node.js
42113

43114
[![node.js version support badge]][node.js]
44115

45-
1. Latest ![node.js icon] [Node.js] LTS _(Long-Term Support)_ version.
116+
The latest ![node.js icon] [Node.js] LTS _(Long-Term Support)_ version is the minimum one supported.
46117

47-
[node.js]: https://nodejs.org/en/
48-
[node.js icon]: https://api.iconify.design/logos/nodejs-icon.svg
49-
[node.js version support badge]: https://img.shields.io/node/v-lts/@terminal-nerds/snippets?style=for-the-badge&logo=nodedotjs
118+
> **Warning**\
119+
> **This package is written in [ES Module] _(ESM)_ type.**\
120+
> 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).
50121
51-
### Optional
122+
**Usage**:
52123

53-
[![supported typescript version badge]][typescript]
124+
Install it first with the Node.js package manager of your choice. In our example, we use [pnpm].
54125

55-
[typescript]: https://typescriptlang.org/
56-
[typescript icon]: https://api.iconify.design/logos/typescript-icon.svg
57-
[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
126+
```sh
127+
pnpm add @terminal-nerds/snippets-regexp
128+
```
129+
130+
And then in a particular file:
58131

59-
1. If you are using ![typescript icon] [TypeScript], then the latest version which supports new features _(such as `satisfies`)_
60-
is recommended.
132+
```js
133+
import { snippet } from "@terminal-nerds/snippets-regexp";
134+
```
135+
136+
[ES Module]: https://www.freecodecamp.org/news/javascript-es-modules-and-module-bundlers
137+
[pnpm]: https://pnpm.io
138+
[node.js]: https://nodejs.org/en/
139+
[node.js icon]: https://api.iconify.design/logos/nodejs-icon.svg
140+
[node.js version support badge]: https://img.shields.io/node/v-lts/@terminal-nerds/snippets?style=for-the-badge&logo=nodedotjs
61141

62142
---
63143

@@ -74,7 +154,17 @@ the [terminal-nerds/snippets] monorepo.
74154

75155
---
76156

77-
## Contributing
157+
## License
158+
159+
[![license badge]][license]
160+
161+
⚖️ For more information, please refer to the [License section] at the root of the [terminal-nerds/snippets] monorepo.
162+
163+
[license]: https://github.com/terminal-nerds/snippets/blob/main/LICENSE.md
164+
[license badge]: https://img.shields.io/github/license/terminal-nerds/snippets?style=for-the-badge
165+
[license section]: https://github.com/terminal-nerds/snippets#License
166+
167+
### Contributing
78168

79169
[![contributors badge]][contributors url]
80170

@@ -87,14 +177,9 @@ if you wish to get involved.
87177
[contributors badge]: https://img.shields.io/github/contributors/terminal-nerds/snippets?style=for-the-badge
88178
[contributors url]: https://github.com/terminal-nerds/snippets#contributors
89179

90-
---
180+
### Author
91181

92-
## License
93-
94-
[![license badge]][license]
95-
96-
⚖️ For more information, please refer to the [License section] at the root of the [terminal-nerds/snippets] monorepo.
182+
🎉 The idea of this project was initiated by [xeho91]. However, it's the [contributors] who matter the most.
97183

98-
[license]: https://github.com/terminal-nerds/snippets/blob/main/LICENSE.md
99-
[license badge]: https://img.shields.io/github/license/terminal-nerds/snippets?style=for-the-badge
100-
[license section]: https://github.com/terminal-nerds/snippets#License
184+
[contributors]: https://github.com/terminal-nerds/snippets/blob/main/README.md#project-contributors
185+
[xeho91]: https://github.com/xeho91

0 commit comments

Comments
 (0)