You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,8 @@
2
2
3
3
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
Copy file name to clipboardExpand all lines: README.md
+64-46Lines changed: 64 additions & 46 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,19 +1,23 @@
1
1
# LazyStreams
2
2
3
-
Welcome to **lazy-streams**, an elegant and modular TypeScript library. Developed by [Monadica](http://monadica.com).
3
+
Welcome to **@monadica/lazy-streams**, an elegant and modular TypeScript library. Developed by [Monadica](http://monadica.com).
4
4
5
5
---
6
6
7
7
## Table of Contents
8
8
9
-
-[Features](#features)
10
-
-[Getting Started](#getting-started)
11
-
-[Project Structure](#project-structure)
12
-
-[Usage](#usage)
13
-
-[Scripts](#scripts)
14
-
-[Configuration](#configuration)
15
-
-[Contributing](#contributing)
16
-
-[License](#license)
9
+
-[LazyStreams](#lazystreams)
10
+
-[Table of Contents](#table-of-contents)
11
+
-[Features](#features)
12
+
-[Installation](#installation)
13
+
-[Getting Started](#getting-started)
14
+
-[Project Structure](#project-structure)
15
+
-[Usage](#usage)
16
+
-[Scripts](#scripts)
17
+
-[Configuration](#configuration)
18
+
-[Contributing](#contributing)
19
+
-[License](#license)
20
+
-[Contact](#contact)
17
21
18
22
---
19
23
@@ -28,11 +32,19 @@ Welcome to **lazy-streams**, an elegant and modular TypeScript library. Develope
28
32
29
33
---
30
34
35
+
## Installation
36
+
37
+
To install the latest version of `@monadica/lazy-streams` from npm, use the following command:
38
+
39
+
```bash
40
+
npm install @monadica/lazy-streams
41
+
```
42
+
31
43
## Getting Started
32
44
33
-
To use this template for your next TypeScript npm package, follow these steps:
45
+
To use or modify this library, follow these steps:
34
46
35
-
### 1. Clone the Repository
47
+
1. Clone the Repository
36
48
37
49
Clone this repository to your local machine and navigate to the project directory.
38
50
@@ -53,7 +65,7 @@ npm install
53
65
54
66
You’re now ready to start building your own TypeScript npm package!
55
67
56
-
Project Structure
68
+
## Project Structure
57
69
58
70
```bash
59
71
lazy-streams/
@@ -91,63 +103,69 @@ lazy-streams/
91
103
└── typedoc.json # TypeDoc configuration file for generating documentation based on TSDoc comments
92
104
```
93
105
94
-
Usage
106
+
## Usage
95
107
96
-
After setting up the template and customizing it for your project, you can start adding your TypeScript code in the src/ directory.
97
-
98
-
Export your public API in src/index.ts, and this will serve as the entry point for your npm package. Here’s an example of a basic function and class you can add:
108
+
Here’s a short example of how to use the `@monadica/lazy-streams` library to create a lazy stream, apply transformations, and retrieve results:
// Take the first 3 elements of the transformed stream and convert to array
120
+
const result =transformedStream.take(3).toArray();
121
+
122
+
console.log(result); // Output: [2, 4, 6]
110
123
```
111
124
112
-
Compile and publish your package when ready, following the Scripts section below.
125
+
This example demonstrates:
126
+
• Creating a lazy stream from an array
127
+
• Using map to transform values
128
+
• Using filter to filter out certain values
129
+
• Using take to limit the results
130
+
• Converting the final stream to an array using toArray
113
131
114
-
Scripts
132
+
## Scripts
115
133
116
134
A set of npm scripts are preconfigured to streamline development and publishing:
117
-
• npm run build: Compiles TypeScript to JavaScript in multiple module formats (ESM, CommonJS, UMD, AMD).
118
-
• npm test: Runs Jest tests.
119
-
• npm run lint: Checks code for linting errors using ESLint.
120
-
• npm run format: Formats code with Prettier.
121
-
• npm run docs: Generates documentation with TypeDoc.
122
-
• npm run release: Bumps version and updates changelog based on commit messages using standard-version.
123
-
• npm publish: Publishes the package to npm (run after npm run release).
135
+
• `npm run build`: Compiles TypeScript to JavaScript in multiple module formats (ESM, CommonJS, UMD, AMD).
136
+
• `npm test`: Runs Jest tests.
137
+
• `npm run lint`: Checks code for linting errors using ESLint.
138
+
• `npm run format`: Formats code with Prettier.
139
+
• `npm run docs`: Generates documentation with TypeDoc.
140
+
• `npm run release`: Bumps version and updates changelog based on commit messages using standard-version.
141
+
• `npm publish`: Publishes the package to npm (run after npm run release).
124
142
125
-
Configuration
143
+
## Configuration
126
144
127
145
This template includes configuration files for various tools, such as:
128
-
• TypeScript (tsconfig.json): Configures compiler options and output.
129
-
• ESLint (.eslintrc.js): Configures linting rules for code consistency.
130
-
• Prettier (.prettierrc): Configures formatting rules for consistent style.
131
-
• Jest (jest.config.js): Configures Jest for unit testing.
132
-
• TypeDoc (typedoc.json): Configures TypeDoc for documentation generation.
146
+
• TypeScript (`tsconfig.json`): Configures compiler options and output.
147
+
• ESLint (`eslint.config.cjs`): Configures linting rules for code consistency.
148
+
• Prettier (`.prettierrc`): Configures formatting rules for consistent style.
149
+
• Jest (`jest.config.cjs`): Configures Jest for unit testing.
150
+
• TypeDoc (`typedoc.json`): Configures TypeDoc for documentation generation.
133
151
134
-
Contributing
152
+
## Contributing
135
153
136
-
We welcome contributions! To contribute: 1. Fork the repository and create a new branch (git checkout -b feature/YourFeature). 2. Make your changes and commit them (git commit -m "Add feature"). 3. Push to the branch (git push origin feature/YourFeature). 4. Open a Pull Request.
154
+
We welcome contributions! To contribute: 1. Fork the repository and create a new branch (`git checkout -b feature/YourFeature`). 2. Make your changes and commit them (`git commit -m "Add feature"`). 3. Push to the branch (`git push origin feature/YourFeature`). 4. Open a Pull Request.
137
155
138
156
If you have any questions or suggestions, please reach out to us at monadicarts@gmail.com.
139
157
140
-
License
158
+
## License
141
159
142
160
This project is licensed under the MIT License.
143
161
144
162
Developed and maintained by Monadica.
145
163
146
-
Thank you for using `template-ts-npm`! We hope this template helps you create amazing TypeScript npm packages with ease.
0 commit comments