ncsoft / Unreal.js

Unreal.js: Javascript runtime built for UnrealEngine
Other
3.61k stars 345 forks source link

How to use npm os lib #135

Open mgtc opened 7 years ago

mgtc commented 7 years ago

I want to use npm lib "macaddress" to get pc mac address, and the lib "macaddress" need nodejs os lib.

So I write test code like as:

var os = require('os'); console.log(os)

UE4 console's log is

Javascript: Invalid script for require Javascript: undefined

How can I use require('os') in Unreal.JS?

nakosung commented 7 years ago

Native nodejs modules are not supported. If you want to access some native functionalities, it is recommended to implement a blueprint function library to host those features.

nakosung commented 7 years ago

@mgtc In case of implementing editor features, you can fork node.js to do serious jobs in native node.js.