Friday, March 31, 2023
Kiratas
  • Home
  • World
  • Lifestyle

    Trending Tags

    • Pandemic
  • Business
  • Entertainment
  • Sports
No Result
View All Result
  • Home
  • World
  • Lifestyle

    Trending Tags

    • Pandemic
  • Business
  • Entertainment
  • Sports
No Result
View All Result
Kiratas
No Result
View All Result
Home World

JavaScript Runtime: Deno 1.30 extends support for Node.js modules

Kiratas by Kiratas
January 27, 2023
in World
Reading Time: 3 mins read
0
0
SHARES
2
VIEWS
Share on FacebookShare on Twitter

The JavaScript and TypeScript runtime Deno has reached version 1.30. In the first release of the year, the runtime from Node.js inventor Ryan Dahl is again dedicated to use with Node.js modules. The release also adds three new APIs that are currently considered unstable: Deno.Conn.ref(), Deno.Conn.unref() and Deno.osUptime(). The latter requires the --allow-sys=osUptime-Permission. the deno.core-Namespace is dropped in this release, which the Deno team says shouldn’t impact most users.

New specifier for Node.js modules

Deno has been offering access to modules integrated in Node.js such as File System, Path or Process since version 1.15 through a compatibility layer. New in version 1.30 is access via node: Specifier:

import { readFileSync } from "node:fs";
console.log(readFileSync("deno.json", { encoding: "utf8" }));

However, importing using a pure specifier is not possible without an import map. For example, would import { readFileSync } from "fs"; lead to an error. If you try this and the specifier resembles a built-in Node.js module that cannot be found in an import map, Deno generates an error message. This indicates what is missing node:-prefix to. The Language Server Protocol (LSP) also offers a quick fix to node: to add specifiers.

Using deno.json as import map

Described by the Deno team as a major update to the configuration file, the deno.json file can now be used as an import map. Developers can now imports– and scopes-Specify keys in configuration. Deno then considers the configuration file as an import map.

The following code is used in deno.json

{
  "imports": {
    "std/": "https://deno.land/[email protected]/"
  }
}

then the following script works with a pure specifier:

import { assertEquals } from "std/testing/assert.ts";
assertEquals(1, 2);

The current innovations can be followed in the Q1 roadmap on GitHub. A blog entry also takes a look back at the past year.

More details on version 1.30 can also be found on the Deno blog.


(May)

To home page

Tags: DenoextendsJavaScriptJavaScript-Runtimemodulesnode.jsRuntimesupportTypeScript

Related Posts

World

Union: Apple fired five activists

by Kiratas
March 31, 2023
World

Handicraft project with ESP32: Controlling lawn sprinklers with a game controller

by Kiratas
March 31, 2023
World

A woman and her father are beaten when they are discovered stealing from their home in Valencia

by Kiratas
March 31, 2023
World

TGQIF – the quiz for the “Matrix” anniversary

by Kiratas
March 31, 2023
World

First Dates: A diner shocks her date by acknowledging that she wants to “do it in a sewer”

by Kiratas
March 31, 2023
Next Post

34 petabytes: all data from the Copernicus earth observation program in one portal

Alignment of Barcelona in the match against Girona

Subscription security: Ubuntu Pro now available to the general public

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Kiratas

Latest News from World, Health, Politics, Sports, Business, Education, Technology, Arts and Latin America, the Middle East, South Asia.
Contact Us:
[email protected]

Categories

  • Automobile
  • Business
  • Sports
  • World

Browse by Tag

Apple Artificial Intelligence Bank business ChatGPT Check Cybercrime data data protection day Energy EU euros February Google government health iOS iPhone law League Linux and Open Source live Mac Madrid March Microsoft million online photo price result Security Smartphone Software Development Spain Spanish Sánchez Test time today Vulnerabilities world year years

Recent Posts

  • Union: Apple fired five activists
  • Handicraft project with ESP32: Controlling lawn sprinklers with a game controller
  • A woman and her father are beaten when they are discovered stealing from their home in Valencia
  • DMCA
  • Home

© Kiratas 2023. All Rights Reserved.

No Result
View All Result
  • Home
  • Landing Page
  • Buy JNews
  • Support Forum
  • Contact Us

© Kiratas 2023. All Rights Reserved.