@rfanth/tjson 0.3.0 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -12,7 +12,7 @@ Add to your `Cargo.toml`:
12
12
 
13
13
  ```toml
14
14
  [dependencies]
15
- tjson = "0.1"
15
+ tjson = "0.3"
16
16
  ```
17
17
 
18
18
  Install the CLI:
@@ -86,17 +86,34 @@ tjson --canonical -i data.json
86
86
 
87
87
  ## WASM / JavaScript
88
88
 
89
- The library compiles to WebAssembly via [wasm-pack](https://rustwasm.github.io/wasm-pack/):
89
+ Install:
90
90
 
91
91
  ```sh
92
- wasm-pack build --target bundler
92
+ npm install @rfanth/tjson
93
93
  ```
94
94
 
95
+ Usage:
96
+
97
+ ```js
98
+ import { parse, stringify } from '@rfanth/tjson';
99
+
100
+ // Render JSON as TJSON
101
+ const tjson = stringify('{"name":"Alice","scores":[1,2,3]}');
102
+
103
+ // With options (camelCase for WASM/JS only)
104
+ const canonical = stringify('{"name":"Alice"}', { canonical: true });
105
+ const narrow = stringify('{"name":"Alice"}', { wrapWidth: 40, stringArrayStyle: 'preferSpaces' });
106
+
107
+ // Parse TJSON back to a JSON string
108
+ const json = parse(' name: Alice');
109
+ ```
110
+
111
+
95
112
  ## Resources
96
113
 
97
114
  - Website and online demo: [textjson.com](https://textjson.com)
98
- - Specification: _coming soon_
99
- - Test suite: _coming soon_
115
+ - Specification: [tjson-specification.md](https://github.com/rfanth/tjson-spec/blob/master/tjson-specification.md)
116
+ - Test suite: [tjson-tests](https://github.com/rfanth/tjson-tests)
100
117
 
101
118
  ## License
102
119
 
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@rfanth/tjson",
3
3
  "type": "module",
4
4
  "description": "Text JSON (TJSON) - a readability optimized, round trip compatible alternative to JSON",
5
- "version": "0.3.0",
5
+ "version": "0.3.2",
6
6
  "license": "BSD-3-Clause",
7
7
  "repository": {
8
8
  "type": "git",
package/tjson_bg.js CHANGED
@@ -100,10 +100,6 @@ export function __wbg___wbindgen_is_object_59a002e76b059312(arg0) {
100
100
  const ret = typeof(val) === 'object' && val !== null;
101
101
  return ret;
102
102
  }
103
- export function __wbg___wbindgen_is_string_624d5244bb2bc87c(arg0) {
104
- const ret = typeof(arg0) === 'string';
105
- return ret;
106
- }
107
103
  export function __wbg___wbindgen_is_undefined_87a3a837f331fef5(arg0) {
108
104
  const ret = arg0 === undefined;
109
105
  return ret;
@@ -133,14 +129,6 @@ export function __wbg___wbindgen_string_get_f1161390414f9b59(arg0, arg1) {
133
129
  export function __wbg___wbindgen_throw_5549492daedad139(arg0, arg1) {
134
130
  throw new Error(getStringFromWasm0(arg0, arg1));
135
131
  }
136
- export function __wbg_entries_28ed7cb892e12eff(arg0) {
137
- const ret = Object.entries(arg0);
138
- return ret;
139
- }
140
- export function __wbg_get_94f5fc088edd3138(arg0, arg1) {
141
- const ret = arg0[arg1 >>> 0];
142
- return ret;
143
- }
144
132
  export function __wbg_get_with_ref_key_6412cf3094599694(arg0, arg1) {
145
133
  const ret = arg0[arg1];
146
134
  return ret;
@@ -173,10 +161,6 @@ export function __wbg_length_e6e1633fbea6cfa9(arg0) {
173
161
  const ret = arg0.length;
174
162
  return ret;
175
163
  }
176
- export function __wbg_length_fae3e439140f48a4(arg0) {
177
- const ret = arg0.length;
178
- return ret;
179
- }
180
164
  export function __wbg_new_1d96678aaacca32e(arg0) {
181
165
  const ret = new Uint8Array(arg0);
182
166
  return ret;
package/tjson_bg.wasm CHANGED
Binary file