Importing and exporting modules with Node.js

Importing and exporting modules with Node.js

Nodecasts

8 лет назад

33,252 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Niluka Monnankulama
Niluka Monnankulama - 17.04.2020 12:33

Saved me, Thanks a lot

Ответить
FuzzyFdmtls
FuzzyFdmtls - 24.02.2020 15:28

Is it working locally?

Ответить
Jaden Hills
Jaden Hills - 14.12.2019 05:39

Life saver

Ответить
Christian Bagaya
Christian Bagaya - 03.12.2019 18:17

How do you import multiple functions that take parameters?

Ответить
aaa bbb
aaa bbb - 08.07.2019 14:14

Nice! To the point. Like it!

Ответить
Ham&cheese
Ham&cheese - 27.05.2019 20:15

beautiful! :D

Ответить
Alordi UX
Alordi UX - 10.01.2019 10:07

Dude, you saved my life tonight. The code I inherited was using some complex module patterns and I needed something simple like your example to get back to a baseline, troubleshoot why I couldn't export my effing module. Works like a charm now. I should have searched for this a few hours ago!

Ответить
Michal Pekar
Michal Pekar - 31.12.2018 23:54

dude I was going through the docs of node.js and it just couldn't go into my head. 2 minutes into your video and my program is working.

Ответить
Jared Kelnhofer
Jared Kelnhofer - 28.11.2018 07:39

Thank you!

Ответить
Intech Solutions
Intech Solutions - 08.10.2018 21:27

nice explanation..

Ответить
Md Ashiqur Rahman
Md Ashiqur Rahman - 07.09.2018 02:32

Very good tutorial , well explained :)

Ответить
JustSome Dude
JustSome Dude - 12.06.2018 21:56

need some help... I can't seem to get require() to work. Any advice? I have tried CommonJS, Browserfy, requireJS - going crazy here please help!

Ответить
Kcxhannel
Kcxhannel - 12.02.2018 07:06

I have a question it's regarding exports but not involve in your video, what is register?
(exports.register) also the only register in the whole code is "var registerEventHandlers = function (eventHandlers, skillContext) "

Ответить
Khaja Mohammed
Khaja Mohammed - 07.06.2017 14:29

Brilliant! Just Brilliant!

Ответить
shiva sai
shiva sai - 18.05.2017 16:41

Im trying to return values using export
But, the console shows undefined

This is my code

playicon.js
module.exports = function sendvalues(val1, val2){
return val1;
return val2;
console.log(val1);
};

database.js
var sqlite3 = require('sqlite3').verbose();
var playicon = require('./playicon');
console.log(playicon); //returning function
console.log(playicon.sendvalues()); returns undefined

I need to return val1, val2 in above function.
Please help!

Ответить
Salman Muradi
Salman Muradi - 17.02.2017 13:46

thank bro. your tutorial was very helpfull

Ответить