JavaScript iCal Library - javascript

I am trying to write an application that will use Ember to post to a Rails app with a Postgres database backend. The application has a front end that deals with users calendars and keeping track of recurrence of events so I thought it would be great to use the iCal format for keeping track of everything and doing exports. Is there a JavaScript library that would work for generating, parsing and exporting iCal formatted events?
Thanks!

There is a NodeJS module called node-icalendar, which you can use in conjunction with browserify (a tool that lets you use NodeJS modules in the browser) generate and parse iCalendar files in your front-end app.
I've used node-icalendar in my own NodeJS apps, without too much luck (that's not to say it won't work for you!). What I personally ended up doing was reading the iCalendar spec and formulating my own super bare-bones .ical file generator that exactly met my needs.

Wouldn't you want to parse the icalendar file on the server with Rails? You could use something like ri_cal.

Related

Is there a way to compile Node.js code to regular JavaScript?

Is there a way to compile Node.js code to regular JavaScript?
I've wanted to use Node.js code for my web application for a while.
I've tried to use Express, but there was no way I could make it work without converting the HTML file to EJS.
I know it is possible because of the way Create React App builds, but I don't know how to achieve that.
Any solution would help, and it would also help me if you could answer some of these questions
(these are some that I tried and gave up on):
Is there a way to access the document variable with express (keep in mind that I'm working with a framework that requires to have access to the document variable)?
Is there any way I could just import modules to my JavaScript file (basically using require() without node)?
Is there any way I could ship the part of Node.js that I actually need togeher with my application (and yes, it is in fact the require() function)?
You are mixing up a lot of concepts and I would strongly suggest reading more about JavaScript and the difference between executing it on the frontend (web browsers) and the backend (NodeJS)...
Here are a few (quick) answers to some of your questions:
Code that runs in NodeJS is regular JavaScript. However if you use NodeJS APIs, it will not run in a web browser, which has a different execution environment runtime.
The document object only exists in a web browser environment, it has no meaning in a NodeJS environment which is a backend.
require is a NodeJS API to load CommonJS packages, it does not exist in a web browser environment. There are alternatives like RequireJS or Browserify, or you can use import for ES modules (with proper CORS details set up).
Express is a server-side routing library, it is not meant to run in web browser environment.
If you are trying to build a web application, you could start by looking into JS frameworks that do the heavy lifting for you like Svelte, Angular, React, Vue (to name only the most popular ones).

deploying a javascript 3rd party library (requirejs/grunt)

Our team is building a javascript library that enables other web apps in our company to consume and insert data into our app, using widgets we built with angular directives.
So we got our own app (that could be used independently), built with MVC .net (in visual studio), and with angular. And also we are producing sort of a javascript library that other apps can use and insert widgets (that are connected to data from our app through ajax calls).
We are really struggling with our deployment proccess. We need the following to happen:
Concatenating and minifyinh our javascript, and in the right order.
Compiling less, and concatenating and minifing css.
Handle external dependencies because we are using multiple 3rd party libraries also, which maybe others are using also.
We know about requirejs, but we are not sure it is suitable for a 3rd party sort of library we are building. Also we want to enable loading as CDN, is it still suitable?
We also know about grunt, but we are not using nodejs but MVC .net. Is it relevant?
We would appreciate your input! Thanks!
I would strongly recommend using a build tool such as Gulp or Grunt, both of which can easily handle the requirements you've given. An added benefit is both can be set up to initiate parts of the build process as files are saved, freeing developers to use any editor they want instead of a particular IDE.

JavaScript file manager with column view

I would like to share documents on my homepage in column-view, so it feels like browsing in Marlin or Finder. How would I start out to do this with JavaScript? Possibly any JS libraries?
I do not have access to any serverside coding, though the server supports PHP5.
You can use UI library. Alternatives with similar UI controls are Sencha, jQWidgets, KendoUI, Wijmo.
For example you can use the jqxMenu by jQWidgets.
The file browsing can be done using the File API but probably you'll need already defined list of files (the use of the File API will be for extra file information).
the guys at sencha make a cracking library which could mimick the Finder style/look, have a look at some of their examples at http://docs.sencha.com/ext-js/4-1/#!/example but would require some serverside coding to return the file data you wish to display...

Excel Module For NodeJS

I want to create .xls .xlsx file from NodeJS but i can't find any stable module for do that.
Is there any stable nodejs module for generating simple excel pages ?
The Excel format is published by Microsoft as an open specification. You can get the spec here in a nicely formatted, intimidating 1200 page PDF.
I've used Microsoft spec documents before to figure out how to implement partial (incomplete) systems that just serve my specific use cases. In other words, if you can figure out the exact bits you need (i.e. just convert a 2d array into some excel rows), then you can often ignore rest of the spec as it doesn't apply to you.
I've also found that looking at solutions written in other languages has helped me - for example, here's a project that uses c#.
Depending on whats available on your backend system, you could spawn a child process that handles the conversion.
Or, you could offload the whole thing to a web service. Google Documents List API allows you to store and manipulate files Google Docs, and then with Google Spreadsheets API you can read and modify the data in Google Spreadsheets.
I realize none of this really addresses your question of the availability of a library, but might give you a new way of solving the problem.
Did you tried the sheetjs? It is the best lib ever!
I also wrote a simple formula parser if you need to evaluate some formula on nodejs server side.
OpenXML SDK for javascript
Use this.

Converting remote RRD to JSON format

I have a project wherein I need to access remotely hosted RRD files and create a highly interactive dashboard to visualize the data (most likely using Rails/Flot etc..)
I've looked into projects such as RRDTool and Jarmon (which seems to be collectd specific) and was wondering if there was a proven way to get the data from the rrd files into a format I can use on the javascript side of things. I intend to have this running on a fairly simple heroku instance, if that's any indicator of my server restrictions.
Thanks so much,
Nader
Have a look at rrdtool xport called on the command line it can produce json for you or when called via a scripting api you get the raw data which you cann then easily convert to json using your scripting language.
HTH
tobi
You need JavascriptRRD:
http://javascriptrrd.sourceforge.net/index.html
As the name implies (Javascript RRD), javascriptRRD is a javascript library for reading and interpreting RRD (Round Robind Database) files from both remote Web servers and local file directories. It uses AJAX-like techniques, but without any code being run on a remote Web server; i.e. it provides a purely client-side access to RRD files.
The javascriptRRD package provides the basic RRD reading libraries, as well as helper libraries to make displaying of RRD files easy with the Flot library.

Categories