“Modules Node.js” Réponses codées

Node nécessiter le module

// Use require.main.require to get a module from the root folder.
const Globals = require.main.require("./globals.js");
const YourCustomModule = require("./yourmodule.js");

console.log(YourCustomModule.message);

// --- yourmodule.js ---
module.exports = {
	message: "Hello World!",
	otherData: "Hello Grepper!"
};
Nathan uses Linux

zone d'un cercle

def circle(radius):
	return radius * math.pi * 2
Charming Chicken

Cercle Python Progrrame

#Area and circumference of a circle.
r=float(input('Enter the radius of the circle :'))
pi=22/7
area=pi*r**2
circumference=2*pi*r
print('The area of the circle is',area)
print('The circumference of the circle is',circumference)
_______________________________________________________________________________
Gr@Y_orphan_ViLL@in##

Modules Node.js

const baseball = require('./babeRuth.js')
Magnificent Monkey Adi

Réponses similaires à “Modules Node.js”

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code