Skip to content

Commit

Permalink
Add Node.js installation and usage instructions
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ptomato committed Jun 15, 2020
1 parent 93e3403 commit 951bafd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,8 @@ When viewing the [reference documentation](https://tc39.es/proposal-temporal/doc
The API will change before the proposal reaches Stage 3, based on feedback that we receive during this time.
Please give us your feedback in the [issue tracker](https://github.com/tc39/proposal-temporal/issues).

## Cookbook
## Documentation

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

## API Documentation

Reference documentation and examples are in progress and can be found [here](https://tc39.es/proposal-temporal/docs/index.html).
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)
14 changes: 12 additions & 2 deletions polyfill/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,28 @@ Please give us your feedback in the [issue tracker](https://github.com/tc39/prop

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

## Documentation

Reference documentation and examples can be found [here](https://tc39.es/proposal-temporal/docs/index.html).

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)

## Import as a Module

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

```bash
$ npm install --save tc39/proposal-temporal
$ npm install --save tc39-temporal
```

In code:
```javascript
const { Temporal, Intl } = require('tc39-temporal');
```

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

## Node REPL with Temporal
Expand Down

0 comments on commit 951bafd

Please sign in to comment.