5.4 C
New York
Friday, January 26, 2024

Deno provides API for date and time operations


Deno 1.40, the most recent model of the JavaScript runtime positioned as a rival to Node.js, has been launched with a Temporal API for superior date and time operations.

The replace was introduced January 25. Deno could be accessed from deno.com.

The Temporal API is meant to deal with shortcomings of the prevailing Date object in JavaScript. It’s accessible with the –-unstable-temporal flag. Temporal acts as a top-level namespace that brings a contemporary date/time API to JavaScript. Temporal supplies separate lessons for date-only, time-only, and different scoped use circumstances, making code extra readable and stopping bugs attributable to incorrectly assuming 0, UTC, or the native time zone for values which are really unknown.

Deno 1.40 additionally embraces the most recent ECMAScript decorator syntax for extra expressive code. With the decorator syntax, Deno now helps the ECMA Stage 3 decorators proposal for browsers. Decorators are a proposal for extending JavaScript lessons and are extensively adopted amongst builders in transpiler environments.

Different options in Deno 1.40 embody the next:

  • Deno now helps the properties import.meta.filename, which supplies a path for the present module file, and import.meta.dirname, which supplies a path to the listing containing the present module file.
  • Constructed-in Node.js APIs are actually accessible resembling fs.constants, os.machine, and course of on (“rejectionHandled”).
  • The imports discipline in deno.json now helps an easier syntax for specifying dependencies which have subpath exports.
  • Diagnostics have been improved with a brand new diagnostic printer in deno lint and deno doc.
  • Integration has been strengthened with the embedded occasion of TypeScript’s Language Service API to realize important efficiency boosts and repair some bugs.

Copyright © 2024 IDG Communications, Inc.



Supply hyperlink

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles