java-enum-loader

0.0.1 • Public • Published

Java Enum loader for Webpack

Loads all of the Enum types declared in a Java source file.

This may be useful if you're writing code that interfaces with a Java app and you want to be able to communicate the same values between the front- and back-end.

Usage

npm install --save-dev json-loader
module.exports = {
  module: {
    loaders: [
      {
        test: /\.java$/,
        loader: "java-enum-loader"
      }
    ]
  }
};
var enumValues = require("src/MyClass.java");
 
// if MyClass.java defines an enum called "Colors" with values:
//
// RED, GREEN, NAVY_BLUE
//
// enumValues will now look like:
//
// { colors: {red: "RED", green: "GREEN", navyBlue: "NAVY_BLUE"}}

Package Sidebar

Install

npm i java-enum-loader

Weekly Downloads

0

Version

0.0.1

License

MIT

Unpacked Size

3.32 kB

Total Files

4

Last publish

Collaborators

  • evanc