Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node.js APIs support #195

Open
valentinstoychev opened this issue May 20, 2015 · 81 comments
Open

Node.js APIs support #195

valentinstoychev opened this issue May 20, 2015 · 81 comments

Comments

@valentinstoychev
Copy link

valentinstoychev commented May 20, 2015

Enable support for the core Node.js APIs so that Node.js dependent modules can be used in {N}.

Please vote for this feature in our ideas portal.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@valentinstoychev
Copy link
Author

Please list any Node.js the APIs you want to see in {N} below. Thanks!

@RangerMauve
Copy link

I'd say that stuff like stream and events, could be easily added with npm modules.

I'd say that fs, net and http are pretty important (and the ones that'd be hardest to replace with pure JS modules), since a lot of modules rely on them.

@RangerMauve
Copy link

I'd also sugest that if anything, have a way to override require calls. For instance, let us specify that require("fs") actually requires a different module like fs-nativescript which can be added as needed. This flow would then be similar to how browserify does things

@jamlfy
Copy link

jamlfy commented May 29, 2015

Well, this is very very cool! I think the best is sent directly to the API nodejs. But I think all the plugins can not be mounted or necestian changes. These would be the main

  • fs
  • stream
  • path
  • event
  • net - WebSocket ;)
  • Debugger
  • Crypto

Although there are several that are already developed... Sure, but I propose the most interesting one that utils is called, but this can be acquired and to format strings.

@NathanaelA

This comment was marked as abuse.

@dead-claudia
Copy link

I need socket for an app I'm intermittently working on, since I need to connect to a non-HTTP port.

My current solution uses Cordova + a specific plugin, but that's gotten clunky in a hurry, because of Cordova's obnoxiousredundant config and that Gulp has little that works with Cordova (I have to use undocumented APIs to make it fit). I can't just use Cordova, because I have to compile my CSS and JS, and Cordova is terrible for running tasks. It's sad, really.

@z3t0
Copy link

z3t0 commented Jun 28, 2015

+1

@akaustel
Copy link

This is really exiting! I would like to see net, crypto and fs. We also have a need for native C/C++ plugins, but I guess that is harder enable.

@piyushcoader
Copy link

hi i am from meteor.js backgroud and nativescript is perfect for createing webApps. Currently the problem i am facing in nativescript is using DDP to connect to my meteor app. there is node-ddp npm packages and it uses websocket. If i am not wrong nativescript doesn't support websocket right? the DDP integration will be great boost for nativescript for creating realtime native mobile apps using nativeScript. and +1 for native script this is what we were searching for years. Thanks

@RangerMauve
Copy link

The thing with node-dpp, is that it uses something that builds on the net module for websockets. There is a nativescript websocket plugin, but getting it to work with node-dpp will be nontrivial from what I understand.

@senikk
Copy link

senikk commented Sep 1, 2015

Have anyone tried this one? https://github.com/emmanuelbuah/asteroid-nativescript "meteor ddp client for nativescript via Asteroid"

@emmanuelbuah
Copy link

@senikk asteroid-nativescript is not ready yet. I was waiting for @NathanaelA websocket lib to complete it. I just haven't had the time to get back to completing it. I plan to get to it by end of this month.

@NathanaelA

This comment was marked as abuse.

@Tim-W
Copy link

Tim-W commented Sep 19, 2015

@NathanaelA Thanks for your contribution to the community. I tried using nativescript-websockets library with ddp.js/node-ddp and ddp-client modules but that didn't work out. Nativescript kept complaining about "module ddp not found" while other modules like moment.js work without any problems in my Nativescript app. Do you have any idea how I could fix this?

@NathanaelA

This comment was marked as abuse.

@kagha
Copy link

kagha commented Nov 13, 2015

I would like to add my voice to those wanting such APIs supported. The crypto API being my personal biggest need at the moment.

@dkarlovi
Copy link

dkarlovi commented Jan 7, 2016

http is quite important, I'm trying to use the existing xmlrpc client which obviously uses it and it seems like a giant hurdle to strip it out and replace it.

The name collision which currently exist seems like a problem too.

@shantamg
Copy link

Crypto would be great!

@Ivshti
Copy link

Ivshti commented Jan 24, 2016

What are the updates on this? Are there any APIs that are implemented?

@NathanaelA

This comment was marked as abuse.

@Ivshti
Copy link

Ivshti commented Jan 24, 2016

It's worth mentioning that I managed to get a lot of things running by using browserify npm modules.

There are little things/conflicts, like having to stick some variables into global, or worse ones.

Regarding fs, there have been substitutes, again for browserify, on top of levelup on top of indexeddb.

However, net would be tricky.

@svc76
Copy link

svc76 commented Mar 7, 2016

hey guys, i am new nativescrit/npm and nodejs. But would like to know where is nativescript in terms of nodejs integration. @Ivshti, how would i leverage your work in my learning.

@dead-claudia
Copy link

@Ivshti

For something like NativeScript, fs and net should actually be doing syscalls. fs should be reading files from the local storage (throwing EACCES errors where necessary) and net should literally be opening low-level ports.

@NathanaelA

This comment was marked as abuse.

@vbudilov
Copy link

@EddyVerbruggen ,

I'll start shortly....I'll keep you posted. Thanks!

@andy-tai
Copy link

andy-tai commented Jan 9, 2017

http, the NodeJS http module

@jeduden
Copy link

jeduden commented Jan 18, 2017

vm module. to create js sandboxes.

@c1ngular
Copy link

NET

@anuragd7
Copy link

+1 tty

@pablocid
Copy link

+1 crypto pleeeeaase!!!!

@vance
Copy link

vance commented Mar 31, 2017

+1 tty because: auth0

@neTAC23
Copy link

neTAC23 commented May 23, 2017

express (I'll be happy to know if there's another way to create in-app http servers)

@crutchcorn
Copy link

@neTAC23 express is not a built in Node.js API

@dead-claudia
Copy link

@neTAC23 You're probably referring to http (NativeScript is missing the server implementation).

@cgebe
Copy link

cgebe commented Aug 23, 2017

crypto is a must, used in so many other node.js modules

@ivanpadavan
Copy link

Here are some new steps of community in relevant direction: https://github.com/janeasystems/nodejs-mobile Unfortunately it's not wrapped as NativeScript plugin. Looks like a lot of work

@NathanaelA

This comment was marked as abuse.

@monjray
Copy link

monjray commented Feb 19, 2018

(Basic) TCP and TLS sockets are an important feature! With this nativescript would get even more complete.
(E.g. nativescript-simple-networking is not working due to one of the open issues listed on github)
@NathanaelA, it would also be very interesting to know where to find the plugin for nodejs-mobile. Thanks!

@NathanaelA

This comment was marked as abuse.

@OMuhammad
Copy link

@NathanaelA any news about the nodejs-mobile plugin? I am trying to implement node-opcua in our NativeScript App and i am stuck as it requires somehow NodeJS. I would be pleased for any solution to a NodeJS support in NativeScript.

Thanks

@NathanaelA

This comment was marked as abuse.

@OMuhammad
Copy link

@NathanaelA yes i understand. Thanks for your reply.

@Pandapip1
Copy link

Any work on this in the past ~5 years?

@NathanWalker
Copy link
Contributor

NathanWalker commented May 11, 2023

Hi @Pandapip1 thanks for bringing this ticket back up, yes this has been a focus of the TSC recently.
Node's fs APIs is where things officially started:
#9811
We are also aligning APIs based on WinterCG baseline spec, in addition to the announced Baseline from Google I/O yesterday, and it's a focus for next major release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests