Habr
β
How to become an author
My feed
All streams
Search
Write a publication
Settings
Login
Pull to refresh
3
0
Василий
@gbazil
Разработчик
Follow
Send message
Profile
Articles
1
Posts
News
Comments
1
More
Dropdown
Bookmarks
Followers
1
Following
Copy RSS link
Экспорт, импорт в Node.JS
gbazil
Feb 8 2016 at 12:40
А так сработоет:
в модуле
module.exports = function() { return «I have not a name»; }
module.exports.abc = ['a', 'b', '!'];
далее в другом файле
var f = require('./module.js');
var str = f();
str += f.abc[2];
console.log(str); // печатает: I have not a name!
Что мне и было нужно.
Рад, что у Вас не возникает таких заморочек )
Information
Rating
Does not participate
Location
Москва, Москва и Московская обл., Россия
Registered
December 15 2013
Activity
February 27 at 08:35
в модуле
module.exports = function() { return «I have not a name»; }
module.exports.abc = ['a', 'b', '!'];
далее в другом файле
var f = require('./module.js');
var str = f();
str += f.abc[2];
console.log(str); // печатает: I have not a name!
Что мне и было нужно.
Рад, что у Вас не возникает таких заморочек )