Skip to content

Commit 951bafd

Browse files
committed
Add Node.js installation and usage instructions
It's not obvious how to use the polyfill as an import. (Unfortunately, it seems it's not possible to export both a CommonJS module and an ES6 module in the same package.
1 parent 93e3403 commit 951bafd

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,8 @@ When viewing the [reference documentation](https://tc39.es/proposal-temporal/doc
5252
The API will change before the proposal reaches Stage 3, based on feedback that we receive during this time.
5353
Please give us your feedback in the [issue tracker](https://github.com/tc39/proposal-temporal/issues).
5454

55-
## Cookbook
55+
## Documentation
5656

57-
A cookbook to help you get started and learn the ins and outs of Temporal is available [here](./docs/cookbook.md)
57+
Reference documentation and examples can be found [here](https://tc39.es/proposal-temporal/docs/index.html).
5858

59-
## API Documentation
60-
61-
Reference documentation and examples are in progress and can be found [here](https://tc39.es/proposal-temporal/docs/index.html).
59+
A cookbook to help you get started and learn the ins and outs of Temporal is available [here](https://tc39.es/proposal-temporal/docs/index.html)

polyfill/README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,28 @@ Please give us your feedback in the [issue tracker](https://github.com/tc39/prop
88

99
Please run the polyfill with Node.js 12 or later.
1010

11+
## Documentation
12+
13+
Reference documentation and examples can be found [here](https://tc39.es/proposal-temporal/docs/index.html).
14+
15+
A cookbook to help you get started and learn the ins and outs of Temporal is available [here](https://tc39.es/proposal-temporal/docs/index.html)
16+
1117
## Import as a Module
1218

1319
You can depend on the unstable Temporal polyfill in your personal projects:
1420

1521
```bash
16-
$ npm install --save tc39/proposal-temporal
22+
$ npm install --save tc39-temporal
1723
```
1824

1925
In code:
26+
```javascript
27+
const { Temporal, Intl } = require('tc39-temporal');
28+
```
2029

30+
Or, import the polyfill as an ES6 module:
2131
```javascript
22-
import { Temporal } from "proposal-temporal/polyfill/lib/index.mjs";
32+
import { Temporal, Intl } from 'tc39-temporal/lib/index.mjs';
2333
```
2434

2535
## Node REPL with Temporal

0 commit comments

Comments
 (0)