Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ultirequiem/y2j
🔄 YAML to JSON and vice versa
https://github.com/ultirequiem/y2j
cli deno json json-to-yaml typescript yaml yaml-to-json
Last synced: 2 months ago
JSON representation
🔄 YAML to JSON and vice versa
- Host: GitHub
- URL: https://github.com/ultirequiem/y2j
- Owner: UltiRequiem
- License: mit
- Created: 2021-10-04T20:01:33.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-09-28T18:22:55.000Z (3 months ago)
- Last Synced: 2024-10-04T15:34:25.626Z (3 months ago)
- Topics: cli, deno, json, json-to-yaml, typescript, yaml, yaml-to-json
- Language: TypeScript
- Homepage: https://y2j.js.org
- Size: 38.1 KB
- Stars: 15
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# Y2J
[![Code Coverage](https://codecov.io/gh/ultirequiem/y2j/branch/main/graph/badge.svg)](https://codecov.io/gh/ultirequiem/y2j)
[![Deno Doc](https://doc.deno.land/badge.svg)](https://doc.deno.land/https/deno.land/x/y2j/mod.ts)YAML to JSON and vice versa 🚀
## Usage
The API is the same on all this platforms ✔️
### [Deno 🦕](https://deno.land/x/y2j)
```javascript
import { JSONtoYAML, YAMLtoJSON } from "https://deno.land/x/y2j/mod.ts";
```### [Node.js 🦖](https://npmjs.com/package/@ultirequiem/y2j)
```javascript
import { JSONtoYAML, YAMLtoJSON } from "@ultirequiem/y2j";
```### [Browser 🌐](https://developer.mozilla.org/en-US/docs/Glossary/Browser)
You can use any [CDN](https://en.wikipedia.org/wiki/Content_delivery_network) 🔥
Eg 👉
[ESM](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) ↔️
[SkyPack](https://cdn.skypack.dev/@ultirequiem/y2j) 🆚
[Script Tag](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script)
↔️ [JSDelivr](https://cdn.jsdelivr.net/npm/@ultirequiem/y2j)## Documentation
Is hosted on [Deno Doc](https://doc.deno.land/https://deno.land/x/y2j/mod.ts) 📚
## CLI
### Install
#### Deno 🐼
```sh
deno install https://deno.land/x/y2j/y2j.ts
```#### Node.js 🎃
```sh
npm install -g @ultirequiem/y2j
```### Usage
```sh
$ y2j example.json
menu:
id: file
value: File
popup:
menuitem:
- value: New
onclick: CreateNewDoc()
- value: Open
onclick: OpenDoc()
- value: Close
onclick: CloseDoc()$ y2j example.yaml
{
"menu": {
"id": "file",
"value": "File",
"popup": {
"menuitem": [
{ "value": "New", "onclick": "CreateNewDoc()" },
{ "value": "Open", "onclick": "OpenDoc()" },
{ "value": "Close", "onclick": "CloseDoc()" }
]
}
}
}
```If you pass the `--write` the output will not be printed. Instead it will be in
a new file with the same name, but with other extension.## Support
Open an Issue, I will check it a soon as possible 👀
If you want to hurry me up a bit
[send me a tweet](https://twitter.com/UltiRequiem) 😆Consider [supporting me on Patreon](https://patreon.com/UltiRequiem) if you like
my work 🙏Don't forget to start the repo ⭐
## Versioning
We use [Semantic Versioning](http://semver.org). For the versions available, see
the [tags](https://github.com/UltiRequiem/y2j/tags) 🏷️## Authors
[Eliaz Bobadilla](https://ultirequiem.com) - Creator and Maintainer 💪
See also the full list of
[contributors](https://github.com/UltiRequiem/y2j/contributors) who participated
in this project ✨## Licence
Licensed under the MIT License 📄