New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

rawtext2json

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rawtext2json

a CLI utility converts raw text files (text, html etc.) to valid JSON files for importing in React Native projects

latest
Source
npmnpm
Version
1.0.9
Version published
Maintainers
1
Created
Source

rawtext2json

a CLI utility converts raw text files (text, html etc.) to valid JSON files for importing in React Native projects

Sometimes, we do need include raw text files (e.g. EULA or Terms of Use) in our apps. It will be nice if we can simply:

import license_content from 'license.txt';

Unfornately, the built-in packager of React Native doesn't support custom loader like webpack. The only way we can acheive that is to convert the raw text file to a valid JSON and import the JSON file in your React Native project (the built-in packager does support JSON file loader).

You can convert your raw text files to valid JSON files using this command line utility and import the JSON:

import license_content from 'license.txt.json';

Install

$ sudo npm install -g rawtext2json

Usage

$ rawtext2json <file>

e.g. Run the following:

$ rawtext2json EULA.txt

You will get a valid JOSN file EULA.txt.json within the same directory.

Keywords

React-Native

FAQs

Package last updated on 15 Aug 2017

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