Skip to content

Commit 4587052

Browse files
authored
Merge pull request #15 from seangwright/feat/esmodule-support
2 parents 7dc2485 + e2e3a8a commit 4587052

24 files changed

+1668
-906
lines changed

.vscode/extensions.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"recommendations": [
3-
"esbenp.prettier-vscode"
4-
],
2+
"recommendations": [
3+
"esbenp.prettier-vscode",
4+
"ZixuanChen.vitest-explorer",
5+
"dbaeumer.vscode-eslint"
6+
],
57

6-
"unwantedRecommendations": [
7-
8-
]
9-
}
8+
"unwantedRecommendations": []
9+
}

.vscode/tasks.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"script": "test",
1616
"group": "test",
1717
"problemMatcher": [],
18-
"detail": "Runs the Jest tests"
18+
"detail": "Runs the Vitest tests"
1919
},
2020
{
2121
"label": "test - watch",
@@ -24,7 +24,7 @@
2424
"script": "test:watch",
2525
"group": "test",
2626
"problemMatcher": [],
27-
"detail": "Runs the Jest tests in watch mode"
27+
"detail": "Runs the Vitest tests in watch mode"
2828
},
2929
{
3030
"label": "typescript - build",

README.md

+55
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,52 @@ A TypeScript implementation of the C# library [CSharpFunctionalExtensions](https
1313

1414
## How to Use
1515

16+
### npm
17+
18+
```bash
19+
npm i typescript-functional-extensions
20+
```
21+
22+
### Unpkg
23+
24+
> Supported since v1.4.0+
25+
26+
#### Full distributed source
27+
28+
<https://unpkg.com/browse/[email protected]/>
29+
30+
#### ES Modules
31+
32+
<https://unpkg.com/typescript-functional-extensions@version/dist/esm/file>
33+
34+
Example:
35+
36+
<https://unpkg.com/[email protected]/dist/esm/maybe.js>
37+
38+
```javascript
39+
const { Maybe } = await import(
40+
'https://unpkg.com/[email protected]/dist/esm/maybe.js'
41+
);
42+
43+
const maybe = Maybe.some('test');
44+
```
45+
46+
### Module Sizes
47+
48+
The distributed library is currently not minified. Below are the module sizes when minified (using UglifyJs) and GZipped:
49+
50+
api.js: 0.17 kb
51+
index.js: 0.09 kb
52+
maybe.js: 0.81 kb
53+
maybe.utilities.js: 0.26 kb
54+
maybeAsync.js: 0.67 kb
55+
result.js: 1.27 kb
56+
resultAsync.js: 0.77 kb
57+
unit.js: 0.14 kb
58+
utilities.js: 0.27 kb
59+
60+
Total: 4.45 kb
61+
1662
### Core Monads
1763

1864
```typescript
@@ -199,3 +245,12 @@ console.log(result.getErrorOrThrow()); // 'Could not retrieve inventory: connect
199245
```
200246

201247
See more examples of `ResultAsync` [in the docs](./docs/resultAsync.md) or [in the tests](./test/resultAsync).
248+
249+
## Contributing
250+
251+
To build this project, you must have v16.17.0 or higher
252+
of the [Node.js](https://nodejs.org/dist/v16.17.0/node-v16.17.0-x64.msi) installed.
253+
254+
If you've found a bug or have a feature request, please [open an issue](https://github.com/seangwright/typescript-functional-extensions/issues/new) on GitHub.
255+
256+
If you'd like to make a contribution, you can create a [Pull Request](https://github.com/seangwright/typescript-functional-extensions/compare) on GitHub.

0 commit comments

Comments
 (0)