Giter VIP home page Giter VIP logo

rawtext2json's Introduction

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.

rawtext2json's People

Contributors

t83714 avatar

Stargazers

MUHAMMAD MANNIR AHMAD avatar  avatar

Watchers

 avatar James Cloos avatar

Forkers

py389172739

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.