Ask coding questions

← Back to all posts
import library
MariamAlketbi (2)

How can we import external module ?

Comments
hotnewtop
SameeraMurthy (110)

Solution

If you are using NodeJS, do:

const module = require('module');

or, for a local module:

const module = require('./path/to/module');

For Python:

import module
Squirrel777 (139)

just do

#Python
import module
//Node.js
var module = require('module')