Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

plainify-loader

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

plainify-loader

Convert JSON to plain object.

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

plainify-loader

npm version Build Status

Convert JSON to plain object.

Sponsored by Evil Martians

Why?

Loader developed for usage with react-intl which can use only plain objects as messages object.

But I like structure used in counterpart.js or Rails I18n, where locales represents as nested object, but ids used by library for traversing over the locales.

Example

in

{
  "key": "value",
  "nested": {
    "other_key": "other_value"
  }
}

out

{
  "key": "value",
  "nested.other_key": "other_value"
}

Warning

The loader provides support only for values represented as strings or objects with strings values because developed for the particular usage.

Installation

npm install plainify-loader

Usage

import json from "json!plainify!./file.json";
// => returns file.json content as JSON parsed and plainified object

or you can use it with yaml-loader

import json from "json!plainify!yaml!./file.yml";
// => returns file.yml content as YAML parsed and plainified object

Contributors

Great thanks to @jumpgh for contributions.

Keywords

FAQs

Package last updated on 21 Aug 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc