4 releases

0.1.3 Nov 3, 2019
0.1.2 Nov 2, 2019
0.1.1 Oct 24, 2019
0.1.0 Oct 24, 2019

#1311 in Text processing

Download history

502 downloads per month

MIT license

5KB
74 lines

text-to-json

Convert text to json in rust.

Install

[dependencies]
text-to-json = "0.1.3"

How to use?

Please check main.rs.

extern crate text_to_json;

use text_to_json::read;

fn main() {
  match read::to_json(String::from("example.txt")) {
    Ok(content) => println!("{:?}", content),
    Err(_) => panic!("Error"),
  }
}

Please check example.txt.

// output
["{\"title\":\"hello world\"}", "{\"description\":\"lorem ipsume sit amet dolor\"}", "{\"date\":\"1211121\"}"]

Dependencies

~0.5–1MB
~20K SLoC