# Global

##

### Members

#### WJsonStream

Description:

  - 基於串流stream的JSON序列化(stringify)與反序列化(parse)

Source:
  - WJsonStream.mjs, line 218

基於串流stream的JSON序列化(stringify)與反序列化(parse)

### Methods

#### createParseStream(filteropt) → {Stream}

Description:

  - JSON反序列化的stream

Source:
  - WJsonStream.mjs, line 107

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`filter` | String | Array | <optional> | `'$*'` | 輸入過濾字串或陣列，預設'$*'

##### Returns:

回傳Stream，為Nodejs的stream物件

Type
  Stream

#### createStringifyStream(data) → {Stream}

Description:

  - JSON序列化的stream

Source:
  - WJsonStream.mjs, line 201

##### Parameters:

Name | Type | Description
--- | --- | ---
`data` | Object | Array | 輸入物件或陣列

##### Returns:

回傳Stream，為Nodejs的stream物件

Type
  Stream

#### (async) parse(str) → {Promise}

Description:

  - Promise化的JSON.parse

Source:
  - WJsonStream.mjs, line 27

##### Parameters:

Name | Type | Description
--- | --- | ---
`str` | String | 輸入字串

##### Returns:

回傳Promise，resolve代表parse成功，回傳物件或陣列，reject代表失敗，回傳錯誤訊息

Type
  Promise

#### parseByStream(str) → {Promise}

Description:

  - 以stream為基底的JSON.parse

Source:
  - WJsonStream.mjs, line 52

##### Parameters:

Name | Type | Description
--- | --- | ---
`str` | String | 輸入字串

##### Returns:

回傳Promise，resolve代表parse成功，回傳物件或陣列，reject代表失敗，回傳錯誤訊息

Type
  Promise

#### (async) stringify(data) → {Promise}

Description:

  - Promise化的JSON.stringify

Source:
  - WJsonStream.mjs, line 125

##### Parameters:

Name | Type | Description
--- | --- | ---
`data` | Object | Array | 輸入物件或陣列

##### Returns:

回傳Promise，resolve代表parse成功，回傳序列化字串，reject代表失敗，回傳錯誤訊息

Type
  Promise

#### stringifyByStream(data) → {Promise}

Description:

  - 以stream為基底的JSON.stringify

Source:
  - WJsonStream.mjs, line 150

##### Parameters:

Name | Type | Description
--- | --- | ---
`data` | Object | Array | 輸入物件或陣列

##### Returns:

回傳Promise，resolve代表parse成功，回傳序列化字串，reject代表失敗，回傳錯誤訊息

Type
  Promise