Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including proposal-temporal with all npm packages installed. Try it out:

var proposalTemporal = require("proposal-temporal")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

proposal-temporal v0.3.1

Experimental polyfill for the TC39 Temporal proposal

Temporal Polyfill

Polyfill for Proposal: Temporal

NOTE: We encourage you to experiment with the polyfill, but don't use it in production! 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 and by taking the survey. More info: https://blogs.igalia.com/compilers/2020/06/23/dates-and-times-in-javascript/

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

Documentation

Reference documentation and examples can be found here.

A cookbook to help you get started and learn the ins and outs of Temporal is available here

Import as a Module

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

$ npm install --save proposal-temporal

In code:

const { Temporal } = require('proposal-temporal');

Or, import the polyfill as an ES6 module:

import { Temporal } from 'proposal-temporal/lib/index.mjs';

Node REPL with Temporal

From this directory:

$ npm run playground

Running Cookbook Files

From this directory:

# Run all cookbook files:
$ npm run test-cookbook

# Run a single cookbook file:
$ env TEST=dateTimeFromLegacyDate npm run test-cookbook-one
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free