-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Give more possibilieteies to converters (#17)
Rediefine Converters Rewrite json converter Rewrite yaml converter change internal handling of converter in file requriere nonce in plugins as symbol
- Loading branch information
1 parent
0e10986
commit 238a261
Showing
33 changed files
with
410 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
--- | ||
|
||
# JSON Converter | ||
|
||
Adding this converter to read json-files as json. | ||
|
||
::: code-group | ||
|
||
```sh [npm] | ||
npm add @loom-io/json-converter | ||
``` | ||
|
||
```sh [pnpm] | ||
pnpm add @loom-io/json-converter | ||
``` | ||
|
||
```sh [bun] | ||
bun add @loom-io/json-converter | ||
``` | ||
|
||
::: | ||
|
||
## Usage | ||
|
||
Before usage you have to register the json converter | ||
|
||
```ts | ||
import Loom from "@loom-io/core"; | ||
import jsonConverter from "@loom-io/json-converter"; | ||
|
||
Loom.register(jsonConverter()); | ||
``` | ||
|
||
The you can read and write json files | ||
|
||
```ts | ||
const jsonFile = await Loom.file("memory://some/json/file.json"); | ||
const data = await jsonFile.json(); | ||
data.val = "test"; | ||
jsonFile.stringify(data); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
--- | ||
|
||
# YAML Converter | ||
|
||
Adding this converter to read yaml-files as json. | ||
|
||
::: code-group | ||
|
||
```sh [npm] | ||
npm add @loom-io/yaml-converter | ||
``` | ||
|
||
```sh [pnpm] | ||
pnpm add @loom-io/yaml-converter | ||
``` | ||
|
||
```sh [bun] | ||
bun add @loom-io/yaml-converter | ||
``` | ||
|
||
::: | ||
|
||
## Usage | ||
|
||
Before usage you have to register the yaml converter | ||
|
||
```ts | ||
import Loom from "@loom-io/core"; | ||
import yamlConverter from "@loom-io/yaml-converter"; | ||
|
||
Loom.register(yamlConverter()); | ||
``` | ||
|
||
The you can read and write yaml files with the ending `yaml` adn `yml` | ||
|
||
```ts | ||
const yamlFile = await Loom.file("memory://some/yaml/file.yaml"); | ||
const data = await yamlFile.json(); | ||
data.val = "test"; | ||
yamlFile.stringify(data); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.