Everything You Need To Know About Singapore Offshore Company

As Singapore is a commodity trade center connecting Asia and the wider world, opening a Singapore offshore company is one of the best ways for international investors to access the Asia market. This…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




How to create a CJS module

Use modules to write reusable code in Node.js

Modules are building blocks of code structures and allow Node.js developers to build better structure, reuse, and distribute code. Since Node v14, there are two kinds of modules, CommonJS Modules (CJS) and EcmaScript Modules (ESM) . This article is about CommonJS modules (CJS).

When importing a CJS module, you have to require it. The result of require is in some cases a function, which creates a new instance, but this is not guaranteed. The require function will always return what is exported from the module.

Let’s create a local module, which will convert any input string to uppercase and use it in five steps.

The output to the terminal should be THIS WILL BE UPPERCASE.

Add a comment

Related posts:

James Dunning of Syrinix On How 5G Technology May Improve and Impact Our Lives

5G infrastructure is being installed around the world. At the same time, most people have not yet seen what 5G can offer. What exactly is 5G? How will it improve our lives? What are the concerns that…

The Worst Leader That No Business Is Talking About

Anyone who has worked a day job in their life or been in group settings has experienced bad leadership before. In fact, plenty of researchers have studied managerial derailment and it can be amounted…

Dampak Modal Fisik Dan Manusia Terhadap Pertumbuhan Ekonomi Sektor Pertanian Di Sumatera Selatan

Sektor pertanian di Indonesia termasuk salah satu sektor yang berperan penting dalam pembangunan ekonomi. Ada beberapa alasan yang mendukung bahwa pentingnya sektor pertanian di Indonesia antara lain…