Giter Site home page Giter Site logo

props2js's Introduction

Props2Js

Props2Js is a command line utility that converts Java properties files into one of three different formats:

  1. JSON
  2. JSONP
  3. JavaScript

The goal is to allow you to easily store configuration data that is needed for JavaScript in a simple format and then transform it into a format you need in your application.

Formats

JSON Format

To convert a properties file into JSON, use the following

java -jar props2js-x.y.z.jar source.properties -t json -o output.json

This reads in the properties file source.properties and outputs the JSON equivalent into output.json.

JSONP Format

To convert a properties file into JSON, use the following

java -jar props2js-x.y.z.jar source.properties -t jsonp --name myfunc -o output.jsonp

This reads in the properties file source.properties and outputs the JSONP equivalent into output.jsonp. This is the same as outputting as JSON except myfunc() is wrapped around the data.

JavaScript Format

To convert a properties file into JavaScript, use the following

java -jar props2js-x.y.z.jar source.properties -t js --name myvar -o output.js

This reads in the properties file source.properties and outputs the JavaScript equivalent into output.js. This is the same as outputting as JSON except var myvar= precedes the JSON and a semicolon follows it.

props2js's People

Contributors

tivac avatar nzakas avatar sripathikrishnan avatar fearphage avatar

Watchers

周惠玲 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.