Giter Club home page Giter Club logo

jvm-npm's Introduction

jvm-npm

Support for NPM module loading in Javascript runtimes on the JVM. Implementation is based on http://nodejs.org/api/modules.html and should be fully compatible. This, of course, does not include the full node.js API, so don't expect all of the standard NPM modules that depend on it to work. If you want to use existing NPM modules that depend on the Node.js API, consider the not-yet-fully-baked nodyn project. If you are writing your own NPM modules in DynJS, Rhino or Nashorn, this should work just fine.

This module is known to work with DynJS, and has been briefly tested on Nashorn, and should work with Rhino as well.

Usage

Using the global load() functions supplied by DynJS, Nashorn and Rhino, load jvm-npm.js into the global execution context:

dynjs> load('./jvm-npm.js');
dynjs> var x = require('some_module');

Or with Nashorn:

nashorn> load('./jvm-npm.js');
nashorn> var x = require('some_module');

Of course, you will need to ensure that the jvm-npm.js file exists in the current directory.

See the examples directory for simple, runnable usage examples. Again, this will only work out of the box for pure JS NPM modules. Anything that depends on the Node.js API will not work with just this file.

jvm-npm's People

Contributors

lance avatar bobmcwhirter avatar aslakknutsen avatar kittylyst avatar download avatar sourya7 avatar

Watchers

SathishBabu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.