npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@shuvam.codes/javapoly

v0.1.3

Published

JavaPoly.js is a library that polyfills native JVM support in the browser. It allows you to import your existing Java code, and invoke the code directly from Javascript.

Downloads

4

Readme

JavaPoly

Building

There is a Grunt script for building JavaPoly. So for building you have to install grunt-cli. Just type command:

$ npm install -g grunt-cli

After this install all needed packages and type:

$ npm install

For building JavaPoly browser version only run command:

$ grunt build:browser

This creates build/javapoly.js file. The javapoly.js will auto-load the js library needed(browserjs.js, doppio lib and so on) from external site(eg, www.javapoly.com)

You can create complete package (including JavaPoly-Node-Doppio, JavaPoly-Node-SystemJVM) by running command:

$ grunt build

For testing JavaPoly-Node-Doppio or JavaPoly-Node-SystemJVM you can run:

$ ./node_modules/mocha/bin/mocha test/TestJavaPolyNodeDoppio.js
or
$ ./node_modules/mocha/bin/mocha test/TestJavaPolyNodeSystem.js

Development JavaPoly

To develop JavaPoly you have to run command:

$ grunt watch

This command runs watching process that updates build-file when you change any js-file in src-folder.

Testing JavaPoly

Tests need to be run in atleast the following two browsers: Firefox and Chromium. (different browser capabilities affect the number and kind of tests that are run).

There is a folder test which should contain a simple build of Doppio and JavaPoly.

Make a build of Doppio and copy / link it into the test/doppio folder.

Note that watching-process updates JavaPoly build in test folder.

You can also rebuild JavaPoly for testing without watching by command:

$ grunt build:test

note, the final javapoly.js file which build:test task generate is a little different from the file which build:browser task generate. the javapoly.js which build:test task generate will load the doppio and browserjs library in local folders. and the javapoly.js which build:browser(or build) task generate will load the doppio and browserjs library from external web site.

To test JavaPoly you should run HTTP server for folder test and open index.html in browser.

We use a custom http server for this. To run it:

$ cd test
$ node server.js

After this, open browser and navigate to http://localhost:8080/index.html. The page contains tests written in Mocha environment.

You can also test JavaPoly via Mocha in nodejs. Install it by typing:

$ npm install -g mocha

And type mocha in projects directory.

Using JavaPoly Core(include JVM) in WebWorker

we could use webworkers if possible(the browser support) , to avoid blocking the main thread.

simply add a worker options in javapoly. The options value is the url of the javapoly_worker.js.(default value is null for not using webworkers)

eg.

new JavaPoly(worker : 'build/javapoly_worker.js');