Skip to content

Commit

Permalink
update package name and version
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrinebensalem committed Dec 3, 2021
1 parent 63b4182 commit 6ffe90a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
convert-units
fork-convert-units
=============

[![Downloads](https://img.shields.io/npm/dm/convert-units.svg)](https://www.npmjs.com/package/convert-units)
[![Downloads](https://img.shields.io/npm/dm/fork-convert-units.svg)](https://www.npmjs.com/package/fork-convert-units)

A handy utility for converting between quantities in different units.

Installation
-----

```bash
npm install convert-units --save
npm install fork-convert-units --save
```

```bash
# beta builds are also available with
npm install convert-units@beta --save
npm install fork-convert-units@beta --save
```

Usage
-----

`convert-units` has a simple chained API that is easy to read. It can also be configured with the measures that are packaged with it or custom measures.
`fork-convert-units` has a simple chained API that is easy to read. It can also be configured with the measures that are packaged with it or custom measures.

The code snippet below shows everything needed to get going:

```js
// `allMeasures` includes all the measures packaged with this library
import configureMeasurements, { allMeasures } from 'convert-units';
import configureMeasurements, { allMeasures } from 'fork-convert-units';

const convert = configureMeasurements(allMeasures);
```

It's also possible to limit the measures configured. This allows for smaller packages when using a bundler like `webpack` or `rollup`:

```js
import configureMeasurements, { volume, mass, length } from 'convert-units';
import configureMeasurements, { volume, mass, length } from 'fork-convert-units';

/*
`configureMeasurements` is a closure that accepts a directory
Expand Down Expand Up @@ -729,7 +729,7 @@ import configureMeasurements, {
LengthSystems,
LengthUnits,
Measure
} from 'convert-units';
} from 'fork-convert-units';

type NewLengthUnits = LengthUnits | 'px';
const DPI = 96;
Expand Down Expand Up @@ -770,7 +770,7 @@ This only applies if moving from `<=2.3.4` to `>=3.x`.

`index.js`
```js
import convert from 'convert-units';
import convert from 'fork-convert-units';

convert(1).from('m').to('mm');
convert(1).from('m').to('ft');
Expand All @@ -788,7 +788,7 @@ convert(1).from('m').to('ft');

`convert.js`
```js
import configureMeasurements, { allMeasures } from 'convert-units';
import configureMeasurements, { allMeasures } from 'fork-convert-units';

export default configureMeasurements(allMeasures);
```
Expand All @@ -806,7 +806,7 @@ import configureMeasurements, {
length,
LengthSystems,
LengthUnits,
} from 'convert-units';
} from 'fork-convert-units';

// Measures: The names of the measures being used
type Measures = 'length' | 'area';
Expand Down Expand Up @@ -834,7 +834,7 @@ import configureMeasurements, {
length,
LengthSystems,
LengthUnits,
} from 'convert-units';
} from 'fork-convert-units';

// Measures: The names of the measures being used
type Measures = 'length' | 'area';
Expand All @@ -860,7 +860,7 @@ import configureMeasurements, {
allMeasures,
AllMeasuresSystems,
AllMeasuresUnits,
} from 'convert-units';
} from 'fork-convert-units';

const convertAll = configureMeasurements<
AllMeasures,
Expand All @@ -875,7 +875,7 @@ convertAll(4).from('m2').to('cm2');
Request Measures & Units
-----------------------

All new measures and additional units are welcome! Take a look at [`src/definitions`](https://github.com/convert-units/convert-units/tree/main/src/definitions) to see some examples.
All new measures and additional units are welcome! Take a look at [`src/definitions`](https://github.com/fork-convert-units/fork-convert-units/tree/main/src/definitions) to see some examples.

Packaged Units
--------------
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "convert-units",
"version": "3.0.0-beta.2",
"name": "fork-convert-units",
"version": "2.3.4",
"description": "Convert between quantities in different units",
"main": "lib/cjs/index.js",
"module": "lib/esm/index.js",
Expand Down

0 comments on commit 6ffe90a

Please sign in to comment.