Is it possible to use a node library on my application? #911
Replies: 4 comments 12 replies
-
post your manifest file and your main.js |
Beta Was this translation helpful? Give feedback.
-
As noted in the New Issue template:
Moving to Discussion. |
Beta Was this translation helpful? Give feedback.
-
Node.js is, more or less, a JavaScript runtime for POSIX. The Moddable SDK is also a JavaScript runtime, however it not built on POSIX because it targets microcontrollers which generally use a lightweight RTOS. Because the XS JavaScript engine in the Moddable SDK implements the same standard programming language (recent edition of ECMA-262) as the V8 engine used in Node.js, the Moddable SDK can run many standard ECMAScript Modules (ESM) that are written for Node.js. Many developers using the Moddable SDK have done this successfully. However, when a Node package depends on APIs or behaviors unique to Node.js runtime, they generally do not work. While Node.js and the Moddable SDK share a programming language, they do not share APIs or behaviors beyond that. The Node.js cron package you mention appears to depend on both the Node.js |
Beta Was this translation helpful? Give feedback.
-
That's a nice number. I assume that's an Espressif part. On silicon with better sleep support, I think the difference is even more significant.
I understand. In that case, it could be acceptable to use a different library instead of the cron package? If so, it would be straightforward to provide some of the same functionality with about the same API but a different implementation. That would be useful to have for embedded developers (I hadn't seen cron before!) What do you think? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I would like to ask about the possibility of using a node library on my project. I'm assuming that my hardware there are capabilities to support it.
In particular, I would like to use cron library. My intention is to execute an action every day at a specific time. For that, I have downloaded the library and his dependency and point for the node_module folder on my manifest file (I try diferent entry and paths). However, I always received a message: "import CronJob not found!"
I would really appreciate it if anybody could help me to use node libraries with Moddable
Beta Was this translation helpful? Give feedback.
All reactions