Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
August 25, 2021 06:23 pm GMT

things to regret about node js today

You have only started using Node agin in the past 6 months, because when RAYAN DAHL created Node, your goal was mainly to program event-driven HTTP servers, and Go is a better language for building faster servers.

But he thinks JavaScript is good. Dynamic languages may not be suitable for building servers that you want to control everything, but they are the right tool for prototyping, such as scientific computing. JavaScript is the best dynamic language.

Your Node problem is almost related to the way you manage user code. Mainly because it focuses on event I/O, the module system is essentially an afterthought.

failed to fulfill the promise

  • It is possible that the unified use of promises in Node will speed up the delivery of standardization and async/await.

Security

  • The node program can access all system calls, such as writing to disk and accessing the network.

Build System

  • If you are writing a module link to a C library, you will use GYP to compile the C library and link it to Node.
  • Chrome used to use GYB, but now Node is the only GYP user.
  • Funky interface, which is a Python adaptation of JSON. The node has several unnecessary complex wrappers.

package.json

  • Includes NPM in Node, making NPM a standard for Node distribution. Centralized repository (privately controlled) of modules.
  • require ("sommodule") is not specific: package.json, local node_modules folder, NPM database.
  • promotes the concept of "module" to an unnecessary abstraction of file directories. It does not exist on the network.
  • includes unnecessary information such as licenses, repositories.

node_modules

  • The analysis algorithm for module is extremely complicated.
  • Vendoredbydefault is kind, but $NODE_PATH will work.
  • There is a deviation from the browser.
  • does not need to be extended.

is unnecessarily unclear.

  • is not the way browsers work.
  • The module loader must guess.

index.js

  • It unnecessarily complicates the module loading system.
  • is especially unnecessary after package.json which needs to be supported.

Deno

https://github.com/ry/deno

Security

  • By default, the script should run without write access to the network or file system.
  • Users can choose to access via the following signs:
    • allownet
    • allowwrite
  • It is not allowed to bind any native functions to V8.

The TypeScript compiler is built into the executable file.

  • TypeScript is beautiful.
  • finally delivered a practical and optional type language.
  • enables code to grow seamlessly from fast hackers to large, well-structured machines.
  • Normal JS should work too.

The simplified module system does not support node modules.

  • The import is just a relative or absolute URL.
  • The import must provide an extension.
  • remote URLs are fetched and cached indefinitely on the first load.
  • can be sold by specifying a non-default cache directory.

Other

  • Only submit an executable file with the fewest links.
  • Start the runtime by compiling the node module with parcel into a package.
  • Always died immediately because of a promise that was not fulfilled.
  • supports top-level wait.
  • browser compatible (window is not global) #node #deno #javascript

Original Link: https://dev.to/vishwasnarayan5/things-to-regret-about-node-js-2ech

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To