Skip to content

Commit 0722618

Browse files
author
Erik
committed
updated name on npm
1 parent 15359eb commit 0722618

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<img alt="react-laag logo" src="./logo.jpg" />
22

3-
[![NPM](https://img.shields.io/npm/v/result-ts.svg)](https://www.npmjs.com/package/result-ts)
3+
[![NPM](https://img.shields.io/npm/v/typescript-result.svg)](https://www.npmjs.com/package/typescript-result)
44
[![TYPESCRIPT](https://img.shields.io/badge/%3C%2F%3E-typescript-blue)](http://www.typescriptlang.org/)
5-
[![BUNDLEPHOBIA](https://badgen.net/bundlephobia/minzip/result-ts)](https://bundlephobia.com/result?p=result-ts)
6-
[![Weekly downloads](https://badgen.net/npm/dw/result-ts)](https://badgen.net/npm/dw/result-ts)
5+
[![BUNDLEPHOBIA](https://badgen.net/bundlephobia/minzip/typescript-result)](https://bundlephobia.com/result?p=typescript-result)
6+
[![Weekly downloads](https://badgen.net/npm/dw/typescript-result)](https://badgen.net/npm/dw/typescript-result)
77

88
Heavily inspired by the Rust and Kotlin counterparts, this utility helps you with code that might fail in a declarative way.
99

@@ -43,21 +43,21 @@ Instead, we could express the outcome of code to be executed in the form of a Re
4343
## Installation
4444

4545
```bash
46-
npm install --save result-ts
46+
npm install --save typescript-result
4747
```
4848

4949
or
5050

5151
```bash
52-
yarn add result-ts
52+
yarn add typescript-result
5353
```
5454

5555
## Usage
5656

57-
result-ts exposes a single type:
57+
typescript-result exposes a single type:
5858

5959
```ts
60-
import { Result } from "result-ts";
60+
import { Result } from "typescript-result";
6161
```
6262

6363
Basically `Result` is a container with a generic type: one for failure, and one for success:
@@ -71,7 +71,7 @@ Result<ErrorType, OkType>
7171
Let's refactor the `readStuffFromFile()` a bit:
7272

7373
```ts
74-
import { Result } from "result-ts";
74+
import { Result } from "typescript-result";
7575

7676
class FileDoesNotExistError extends Error {}
7777

@@ -309,7 +309,7 @@ const result = doA().map(value => doB(value)); // Result<ErrorA | ErrorB, string
309309

310310
There are cases where a series of operations are performed that need to be treated as a 'unit of work'. In other words: if the last operation fails, de preceding operations should also fail, despite the fact that those preceding operations succeeded on their own. In such cases you probably want some kind of recovering a.k.a. a rollback.
311311

312-
Fortunately, result-ts allows you to rollback your changes with the minimum amount of effort.
312+
Fortunately, typescript-result allows you to rollback your changes with the minimum amount of effort.
313313

314314
### Example
315315

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
2-
"version": "0.1.0",
2+
"private": false,
3+
"version": "1.0.0",
34
"license": "MIT",
45
"main": "dist/index.js",
56
"typings": "dist/index.d.ts",
@@ -29,9 +30,9 @@
2930
"singleQuote": false,
3031
"trailingComma": "es5"
3132
},
32-
"name": "result-ts",
33+
"name": "typescript-result",
3334
"author": "Erik Verweij",
34-
"module": "dist/result-ts.esm.js",
35+
"module": "dist/typescript-result.esm.js",
3536
"devDependencies": {
3637
"husky": "^4.2.5",
3738
"tsdx": "^0.13.2",

0 commit comments

Comments
 (0)