Giter Club home page Giter Club logo

javascript.util's Introduction

javascript.util

javascript.util is a port of selected parts of java.util to JavaScript which main purpose is to ease porting Java code to JavaScript.

javascript.util can be used in browsers or as a Node JS module.

Build Status

API docs

Usage

Browsers

Simply include javascript.util.min.js on your page.

Node JS

Install latest released version:

    npm install javascript.util

A simple Node JS code example using javascript.util:

    require('javascript.util');
    var ArrayList = javascript.util.ArrayList;
    var array = new ArrayList();
    array.add(1);

Development environment

Linux or similar is assumed.

Dependencies

  • Node JS
  • mocha (for tests)
  • chai (for tests)
  • bower (for dependencies)
  • grunt (for builds)

Unit tests

    npm test

javascript.util's People

Contributors

bjornharrtell avatar johanhasselstrom avatar stevenlooman avatar sweco-sebhar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

javascript.util's Issues

Debugging is suboptimal

Need to find a way to debug as easy as before (using FireBug or similar and running the code from individual class files)

Doesn't install properly if the consumer doesn't have python available on their path

I assume this is related to #10 somehow

> [email protected] install D:\sources\temp\node_modules\javascript.util
> grunt

Running "bower:install" (bower) task
>> Installed bower packages

Running "closureDepsWriter:main" (closureDepsWriter) task
Executing: python bower_components/closure-library/closure/bin/build/depswriter.py  --root_with_prefix="src ../../../../src" --output_file=deps.js
>> Error: Command failed: C:\Windows\system32\cmd.exe /s /c "python bower_components/closure-library/closure/bin/build/depswriter.py  --root_with_prefix="src ../../../../src" --output_file=deps.js"
>> 'python' is not recognized as an internal or external command,
>> operable program or batch file.
>> FAILED to run command for target: main
Warning: Task "closureDepsWriter:main" failed. Use --force to continue.

Aborted due to warnings.
npm ERR! [email protected] install: `grunt`
npm ERR! Exit status 3
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the javascript.util package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     grunt
npm ERR! You can get their info via:
npm ERR!     npm owner ls javascript.util
npm ERR! There is likely additional logging output above.

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\ProgramData\\Chocolatey\\lib\\nodejs.commandline.0.12.0\\tools\\node.exe" "C:\\ProgramData\\chocolatey\\lib\\npm.1.4.9\\tools\\node_modules\\npm\\bin\\npm-cli.js" "install" "javascript.util"
npm ERR! cwd D:\sources\temp
npm ERR! node -v v0.12.0
npm ERR! npm -v 1.4.9
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     D:\sources\temp\npm-debug.log
npm ERR! not ok code 0

Failing test when using jasmine-node

Exception occurs at /spec/ArrayList.js:52:42 => TypeError: Expecting a function in instanceof check, but got NoSuchElementException.

For some reason NoSuchElementException isn't defined when running the tests this way?

Loading javascript.util in V8 from command line does not work

Hi,

When I load javascript into to command line of V8 I get:

d8 ../../jsts/lib/javascript.util.js --shell
V8 version 3.15.11.2 [console: dumb]
d8> javascript
(d8):1: ReferenceError: javascript is not defined
javascript
^
ReferenceError: javascript is not defined
at (d8):1:1

d8>

Can this be solved easily?

Thanks!
Karel

Should there be a reference to bower_components in node script?

Looks like this was something that was picked up in 0.12.6 but seems to be breaking because it can't be found?

$ node app.js 
module.js:338
    throw err;
          ^
Error: Cannot find module '../bower_components/closure-library/closure/goog/bootstrap/nodejs'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:278:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/Users/flasher/workspace/population/node_modules/turf/node_modules/turf-erase/node_modules/jsts/node_modules/javascript.util/dist/javascript.util-node.min.js:42:237)
    at Object.<anonymous> (/Users/flasher/workspace/population/node_modules/turf/node_modules/turf-erase/node_modules/jsts/node_modules/javascript.util/dist/javascript.util-node.min.js:42:339)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)

@morganherlocker initially ran into this when trying to use turf.js.

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.