Git Product home page Git Product logo

spundle's Introduction

spundle

Bundle spud-format .properties locale bundles into a JSON object for transport to the client.

This is a low-level library used in build tools to get an easy-to-transport pre-parsed pile of strings to ship to a browser or other places.

Use

var spundle = require('spundle');
spundle(appRoot, '*', '*', callback); // Load all content for all countries and languages
spundle(appRoot, 'US', 'en', callback); // Load content for en-US only

This is painfully specific to Kraken.js default layout currently, and is naive about paths mapping to parameters. A future version may refine the interface.

spundle's People

Contributors

aredridel avatar gabrielcsapo avatar grawk avatar jasisk avatar wedneyyuri avatar

Stargazers

 avatar  avatar

Watchers

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

spundle's Issues

Spud unhandled error

In the following line:

out[getKey(dir, ent)] = spud.parse(file);

spud.parse() can throw an error when parsing which is not handled properly.

For example:

# somefile.properties
some.key=Some value
some.key.err=Should throw error

Will throw: TypeError: Cannot create property 'err' on string 'Some value' because it is trying to add a property err to some.key which is already defined as a string.

This can be resolved by handling the error and calling callback when this happens.

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.