Send Firebase Push Notification using Node Module - javascript

I am trying to use NodeJS module to send Push Notification.
Looking at 'node-sender' module and do not see option to send to Browser (for testing):
https://www.npmjs.com/package/node-sender
What Node Module do you recommend for sending PN?
Thanks.

You could give node-pushnotifications a shot. They have a very detailed documentation and quite fairly used.

Related

How does one go use MongoDB with native JS?

I have been searching but sadly haven't found any resources for using MongoDB with native JS. Every resource I find seems to be NodeJS.
I want to use MongoDB on vanilla JS, so to speak.
See How to connect MongoDB with VanillaJS?
and also link from top comment Connecting MongoDB to the front-end?
You see everyone use node.js because by design, mongodb is meant to communicate with the server only and the server decides how to handle the data. By using nativejs directly (assuming it was possible without using cloud APIs) is a huge security risk. NativeJS advertises itself as "running inside your browser", I wouldn't want my backend code to be exposed to the user.
TL;DR you should use cloud integrations of mongoDB (mongoDB cloud etc.) or use node.js like everyone else.
TL; DR: You can't
MongoDB is not supposed to expose data directly to front-end (client side). NodeJS (in this case; MongoDB can be used with a variety of other server-side engines) is a server-side JavaScript engine that acts as a bridge between the client and the database.
However, you can have a look at MongoDB APIs
The better way, however, would be to have a server between your database and the web interface, that queries or inserts data from your MongoDB database. If your database has to be client-sided though, have a look at firebase.
If you only want to store data on the client, you could simply use LocalStorage API
If not, you either need to render all the data needed in your page content, or query it via js Fetch API
Even the native mongosh is a NodeJS environment, see MongoDB Shell:
The MongoDB Shell, mongosh, is a fully functional JavaScript and Node.js 16.x REPL environment for interacting with MongoDB deployments.
The legacy mongo shell is also a JavaScript shell, seems to be based on SpiderMonkey, see https://www.mongodb.com/community/forums/t/why-change-v8-to-spidermonkey-in-mongodb-js-engine/99871

Is creating an email application possible with angular?

Is creating an email application possible with angular?
I tried implementing nodejs script but it's not working due to using nodejs script inside angular ts file, giving me the following
Error: Module not found: Error: Can't resolve 'imap'
Any help or guide would be much appreciated.
Thanks
You cannot use modules which depend on Node.js features from a browser. The imap module depends on such a feature: it requires the ability to make raw network requests.
The block here is at a lower-level than Angular.
You could replace direct IMAP (and SMTP) access with a web service since browsers support HTTP and WebSockets.
You can’t make IMAP/SMTP connections directly from the browser, but you could use something like EmailEngine as the backend for any email related actions.

How to get the content of an attachment with the JS SDK for S4/HANA?

So I am currently in the process of learning the new Javascript Cloud SDK. Of course there is also a package for attachments and document info records but I am still facing some problems.
So mainly I just want to get an attachment which is attached to a document info record and safe it to my local file system. I am working with the JS Cloud SDK so I am working with a Node application.
When working with the API directly (testing via Postman) I can get the media_src of the attachment simply by adding '$value' to the request path. When I try to access this URL outside of Postman with a simple Node https.get request I get a SAML 2.0 Error (SAML2 Service not accessible). I guess that is because I cannot access those URLs via browser and therefore I should use the SDK for that.
So the final problem I am facing is that I cannot find anything about getting the file itself in the JSDoc of the SDK.
Same goes also for creating an attachment. Should I use the 'builder()' method for that and pass a JSON object or how does a POST or PUT request work with that SDK? I cannot find any blogs etc. because they are only doing simple 'Hello World' programms or GET some data.
thanks for reaching out to us!
Currently, we do not support OData media streams in the JS SDK's VDM yet.
If this functionality is critical for you, you can consider using the Java version of the SDK. Alternatively, you can open an issue here.
Regarding the SAML error I cannot comment, since I don't how your Postman is configured or how your system is setup.

electronjs and node server communication

I have a node server and i have an elektron desktop app (electronjs).they are in the same machine. I need to comminicate each other.
But i need to do this in main process i dont want to use renderer
processes.In my Case my renderer process can only talk with main.
Fistly, i thought that I can Create an API ,so node server send http request and i can get request then i will do my jobs in electron. But I coundt find any way to do this.
Secondly, i thought that I can use socket.io and send to json data(in main proccess) and again i couldnt find any way.
One of them is enough for me. I searched but i coudnt find a way to do this. Is there a Single code example or a link or an explanation.. Thanks.

Node.js module for RDF store (persistent) and support for SPARQL HTTP Protocol?

I am looking for a Node.js module that will act as persistent RDF storage and also will have support for an SPARQL protocol (endpoint).
Actually, I have/will some RDF that I should publish as Linked Data and also to allow access to the RDF data through a SPARQL endpoint.
Any help is welcome! Thanks.
Cheers!
RDFStore-js now supports persistence, using MongoDB as the backend, and the SPARQL protocol for HTTP access.
You can take a look at the 'Stand-alone SPARQL end-point' section of the README file for the details.
A quick google search turned up this on Github - https://github.com/antoniogarrote/rdfstore-js
Looks like it will do exactly what you want
I'm bumping this thread since I was looking for similar solution and found something.
As of today, there is a set of 3 NodeJS modules filling the use case and still maintained:
quadstore : implementation of a RDF store
quadstore-sparql : the sparql engine to query the store
quadstore-http : the HTTP server that expose endpoint
I just created a gist on github with a minimal usecase : https://gist.github.com/antoine-morvan/0b0505147771c492e25a90f88ca4ea40

Categories