What JavaScript Repository should I use? [closed] - javascript

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
Many languages have standard repositories where people donate useful libraries that they want others to have access to. For instance Perl has CPAN, PHP has PEAR, Ruby has RubyGems, and so on. What is the best option for JavaScript?
I ask because a few months ago I ported Statistics::Distributions from Perl to JavaScript. (When I say ported I mean, "Ran text substitutions, fixed a few things by hand." I did not rewrite it.) Since I've used this module a number of times in Perl, I figure that statistics-distributions.js is likely to be useful to someone. So I've put it under the same open source license as the original (your choice of the GPL or the Artistic License). But I have no idea where to put it so that people who might want it are likely to find it.
It doesn't fit into any sort of framework. It is just a standalone library that gives you the ability to calculate a number of useful statistics distributions to 5 digits of accuracy. In JavaScript.

JSAN (JavaScript Archive Network) sounds like the kind of thing you're looking for, but I've never personally used anything from it apart from Test.Builder.
As long as your JavaScript can be dropped in to people's projects without polluting the global namespace or doing things which are liable to cause breakage in other people's code (adding to Object.prototype, for example) I would just stick it somewhere like Google Code as already suggested.

There is no centralized repository for JavaScript. JS Libraries usually have their own plugin-repositories, but for stand-alone scripts, The best way to promote it is to send it to famous website such as ajaxian or mashable

AFAIK, there is no central JavaScript repository, but you might have success promoting it on Snipplr or as a project on Google Code.

You could start a project on SourceForge to contain useful snippets of code like this (or google for snippets to find one).

Perl, Ruby, PHP, etc all have distribution mechanisms built into the language to consume such libraries.
There's not such a thing built into JS.
There are tons of script archives out there - but no "central" JS repo.

Consider packaging it up as a plugin for one of the major Javascript libraries such as jQuery - see http://docs.jquery.com/Plugins/Authoring for more details. This way it can be included on their plugin page which will get it good exposure as they have a huge developer base and it'll be one of their first ports of call when a need arises for such functionality.
Whilst jQuery is one of the most popular frameworks (if not the most) out there, there are a host if other libraries you could consider using in addition to/instead of it.

Related

HTML/JS site templates? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I'm a PHP programmer that was just hired to write an interactive ipad app whose requirements are basically that it be a website. So I started setting up to develop a website when I found out that my employer's server has been lobotomized: no dynamic languages, the only things I'm allowed to code with are HTML and JavaScript.
AJAX and jQuery are still in, but as far as I can tell they won't have a server-side language to back them up. If I have an urgent and compelling reason to have an active language, I might be able to convince the senior web guy to give me an exception, but I don't think my project qualifies as urgent or compelling by about two orders of magnitude.
My question then, is what sort of labor-saving devices are out there for HTML/JS only sites? I would have liked to use something like Drupal. Would I be better off writing the whole thing in XCode?
The site will display information regarding a number of historical artifacts in the possession of the library that is my employer.
It would help if you were more specific about your needs (the kinds of things you do in PHP that you don't know how to do with just HTML/JS), but I think I know what you're getting at.
If the site isn't too complicated, a good client-side templating engine is probably what you're looking for. Handlebars.js is a popular choice, but there are tons to choose from. I prefer to use client-jade, but it doesn't matter much. The idea is to define a template (e.g. for displaying one historical artifact), then iterate over an array of data that describes all the artifacts in the library, rendering each element of the array into some pretty-looking DOM with your template.
If you need something more sophisticated than that, you might want a client-side MVC framework like Backbone.js (lightweight, easier to learn, less opinionated) or Angular.js (heavier, harder to learn, very opinionated).
If the labor you're trying to save yourself from doing is styling work, you might want to check out twitter bootstrap (or similar frameworks like foundation). Bootstrap makes it easy to create good-looking navbars, make column-based layouts, and ensure that your site looks good across different browsers and devices.

legality of unpacking minified javascript [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I know that this is more of a legal question but I thought I'd give this a shot.
I am learning javascript and I found some interesting drop down menu's on a webpage. I wanted to learn more about them but the code is minified with the following in the comments above the minified code:
// Unauthorized decryption/reproduction of any codes contained herein is strictly prohibited and will result in severe civil and criminal penalties.
Is it really illegal for me to unpack the code and look through it? Can I be sued for looking at code without actually using it?
I'm no expert, but if there were anything criminal about viewing a website's source code, then browsers would not make it so easy.
While I can definitely say that using someone else's code without permission is wrong, I think it's a great thing to learn from it.
IANAL
Minification is not encryption. You already have permission to copy the file to your machine and open it (as your browser requires these permissions to use it). There is no legal protection for examining the contents of a file that's freely available. You can even modify it on your own system at will, these sorts of copyright allowances fall under fair use because you're doing so for educational purposes.
What you can't do is distribute the file or the modified file.
In my honest opinion, it shouldn't (and probably isn't) illegal to look at the code since it's open to anyone.
Using and learning from the source code are two completely different things.
Using someone's work without their permission is simply wrong no matter what the context is (code, images, art, etc).
But learning from other source code is probably the best way to learn and get better.
As for their legal note, I think they just put that there to scare people off but I don't think it would stand in court.

Node JS, traditional data structures? (such as Set, etc), anything like Java.util for node? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 months ago.
Improve this question
I'm loving node JS and, coming from a Java background, am interested in even trying it out for some projects where node may seem a bit of a stretch, such as a search engine project.
One thing I've been a bit confused by is it seems JavaScript is lacking traditional data structures, for example a set, which has a precise definition extending even beyond computer science as it has been used in mathematics before computers existed (basically a list that doesn't allow duplicates). It seems when using node JS there is no library like Java.util that has these basic data types that I have grown accustomed to, I realize I could create them myself but this just adds more overhead to the project.
Are there any libs for node (or JavaScript in general) that address this? I think node has a lot of potential to replace the use of a language like Java for a lot of projects as it has so many advantages in terms of development speed, but having to recreate data structures that are taken for granted in a more mature platform could be too much overhead for a small project.
I apologize if there are other questions like this, however I spent some time searching and didn't come up with much.
es6 has a Set class built in:
new Set([iterable]);
see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set
Collections.js has Lists, Maps, Queues, Sets, and Heaps, all with consistent interfaces. Github.
it seems JavaScript is lacking traditional data structures...
Yes, this is javascript, the very concept and implementation of data structure is done quite differently from languages like Java.
I'm not sure that you're really going to find what you're looking for with Javascript. Howver, there are some libraries like underscore that should make it easier to build the type of structures that you want.
Its no longer true that node.js doesn't have Set and Map objects among other things. node.js has had them since at latest v12.
But of course, if you want libraries like java has, check npm or github. You're not limited to what comes standard in node.js.
Have you looked into Underscore.js? http://underscorejs.org/
It's not a one to one with java.util but it provides a bunch of commonly needed utility functions.
As a lighter and faster alternative to Underscore.js, Lo-Dash (http://lodash.com/) is getting traction those days... But this is not Java.util! :-)
Have a look at this one: https://github.com/chenglou/data-structures
I think it fits what you are looking for.
js-sdsl
A javascript standard data structure library which benchmark against C++ STL.
This library has strict time complexity guarantee and can be used with confidence.
The latest beta version includes iterator functions which can be used like iterator in c++.
Included data structures
Vector
Stack
Queue
LinkList
Deque
PriorityQueue
Set (using RBTree)
Map (using RBTree)
HashSet (for reference only)
HashMap (for reference only)
Usage
To help you have a better use, we provide this API document.

RIA liblaries/framework in day-to-day development [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
I need to develop quite simple web application with some Ajax functionality and GUI components with Java as a server-side language. The main purpose for me is to learn sth about designing web app that I can make use of when I start looking for a job ... .I ran into lots of framework (RAP, Nice JSF implementations etc.) and there are also GWT and JQuery . I started reading about GWT and it seems to be great at the beginning, but there are limited number of visual components. When You missed one it seems to be much harder to write it with GWT than in JavaScript/JQuery (e.g sortable components).
Also:
If JavaScript is is easy why to learn API to just make translation?
The main argument seems to be that GWT is for developers who don't
know Java Script very well, but is JS harder than GWT API and
configuration to work with?
GWT offers also very nice Remote Procedure Call and translating
objects to JS, but there are lots of libraries like DWR.
You need also to use standard servlet to e.g send file stream to a
user, so You need also to save it to a Database or as a hidden XHTML files to make them available to servlet.
So should I start to learn GWT? It is really wide spread? Or maybe JSF implementations with Ajax support outperforms GWT in usability? The biggest problem I have that I cannot imagine how to solve simple problems in GWT while they are almost complete solutions with JQuery. Mixing JavaScript native code with GWT don't seems to be a good option also.
When working with GWT, its always better to now whats going on behind. So you have to learn HTML, CSS and JavaScript as anyway. Maybe you can start with less knowledge on browser frontend technologies. But you will come to the point where you need to know whats going on.
So ask yourself. Is your app large enough that its worth to start with complex GWT app. Also if you're on a large team and familiar with JAVA, Maven and Junit it makes senses.
On the other hand there are a bunch of small (backbone.js with jquery), middle (mootools) or large (extjs) JavaScript frameworks to build RIA.
I've never work with JSF, but all people a meet that used it, wasn't really satisfied.
After all I dont think its a good idea to select a framework by the current feature set of your app. As this can change of the time, you will have to implement it later with a technologie you not familiar with.
Note there is a table sort library for GWT as well: http://code.google.com/p/gwt-advanced-table/
GWT contains several unique features which make it difficult to be compared with other frameworks. The key point is that GWT isn't just a framework or library -- it's a toolkit. Consider:
Ability to use Java IDE's and debugger during development
Automatic generation of compiled scripts optimized for different browsers
Benefits of java for organization of code-base: OOP, package system, checked exceptions, compile-time type-checking etc.
These features make GWT suitable for big projects built by large teams that should be enhanced and maintained over a large time-frame. Off course, many projects do not have such requirements and therefore developers should give more weight to other consideration like widget library and learning curve.

Is there a free/open-source JavaScript-to-JavaScript compacting compiler (like Google's)? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
If you look at the source of Google pages with JavaScript, you'll find that the JavaScript is clearly not readable -- or maintainable. For example, all variables and functions are one-letter named (at least, the first 26 are...); there are no extraneous white-spaces or linebreaks; there are no comments; and so on.
The benefits of this compiler are clear: pages load faster, JavaScript execution is faster, and as a bonus, competitors will have a hard time understanding your obfuscated code.
Clearly, Google is using some sort of a JavaScript-to-JavaScript compacting compiler. I am wondering if what they're using is an in-house tool? If not, what are they using? Are there any publicly available (ideally, free/open-source) tools of that sort?
YUI Compressor is a Java app that will compact and obfuscate your Javascript code. It is a Java app that you run from the command line (and would probably be part of a build process).
Another one is PHP Minify, which does a similar thing.
Another one is ShrinkSafe that is part of Dojo but may be used stand-alone (either in a build script, command line or at the website):
http://shrinksafe.dojotoolkit.org/
You may be looking for GWT - it's Java-to-JavaScript rather than JavaScript-to-JavaScript, but you may still find it useful.
I can't comment on what internal tool, if any, we use for JavaScript-to-JavaScript. (To be honest, I don't even know offhand... I'd have to look it up before explicitly not telling anyone :)
It's actually pretty unlikely to be JS->JS, much more so to be Java->JS. These days I believe the recommended JS compressor (for this is what they're called) is the YUI compressor, but others like /packer/ exist
Crockford.com's JSMin is one step in that direction, assuming you're only looking for minimization and not obfuscation.

Categories