Git Product home page Git Product logo

properties's Introduction

properties

gmodproj >= 0.4.0

Requirements

  • moonscript - Via require for MoonScript-based property files.
  • lpeg (or a suitable polyfill such as LuLPeg) - Required for MoonScript-based property files.

Description

A standalone platform-independent Lua library, facilitating encoding and decoding of Lua tables into human-readable properties files.

Documentation

Currently missing a more readable form of documentation, although everything under the src directory annotated.

Properties Format

Currently properities only supports two encoding formats usable in encode(table value, table EncoderOptions?) and decode(string value, table DecoderOptions?).

EncoderOptions.propertiesEncoder == lua

Supports encoding and decoding of Lua tables into human-readable Lua files

sample.lprop

tableProp = {
    testProp = 'testValue'
}

main.lua

local properties    = import 'novacbn/properties/exports'
local tableProp     = properties.decode(..., {
    propertiesEncoder = 'lua'
})

print(tableProp.testProp) -- prints 'testValue'

EncoderOptions.propertiesEncoder == moonscript

Supports encoding and decoding of Lua tables into human-readable MoonScript files.

sample.mprop

tableProp:
    testProp: 'testValue'

main.lua

local properties    = import 'novacbn/properties/exports'
local tableProp     = properties.decode(..., {
    propertiesEncoder = 'moonscript'
})

print(tableProp.testProp) -- prints 'testValue'

Installation

If wanting to use with a standard Lua platform, download the latest properties.lua build from Releases. And use it as you would any other library.

Alternatively, if using with gmodproj. Download the latest .zip or .tar.gz archive from the Releases. Extract the contents of src directory into your project's packages directory under a novacbn/properties directory.

Building

# Clone the repository
git clone https://github.com/novacbn/properties

# Move into the project and make the build directory
cd properties
mkdir ./dist

# Building the project will produce `./dist/properties.lua`
gmodproj build # Or gmodproj build production

properties's People

Contributors

novacbn avatar

Watchers

 avatar  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.