@resource-sentry/reader-json
Resource Sentry JSON Reader.
Last updated 2 years ago by nicolassiver .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @resource-sentry/reader-json 
SYNC missed versions from official npm registry.

Reader: JSON

Combines all properties from a single or directory of JSON files. The reader can walk through deeply nested objects with some conventional limitations.

  • Visits only first element of Array
  • Adds parent property to the qualifying name
  • Converts Boolean to a Number (Example: 0 or 1)
  • Converts null to a NULL <String>
  • Converts empty Array to a NULL <String>

Version Dependencies

Installation

yarn add --dev @resource-sentry/reader-json

Configuration

  • entry, path to a single or a directory of JSON files
  • deep, limit for nesting. Where 0 disables walk through nested objects. By default there is no limitation if this optional parameter is not provided.

Example

{
  "title": "My Title",
  "desc": {
    "header": "Big Header"
  }
}

JSON will be explored and added into rs.js file ready for use in production code.

import * as Rs from './rs';

Rs.getResource(Rs.Text.TITLE); // Return "My Title"
Rs.getResource(Rs.Text.DESC_HEADER); // Return "Big Header"

Current Tags

  • 1.0.0                                ...           latest (2 years ago)

1 Versions

  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 2
Last Week 2
Last Month 2
Dependencies (3)
Dev Dependencies (1)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |