Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@travetto/yaml

Package Overview
Dependencies
Maintainers
1
Versions
160
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@travetto/yaml - npm Package Compare versions

Comparing version 1.0.0-rc.9 to 1.0.0

README.js

7

package.json

@@ -9,2 +9,3 @@ {

},
"title": "YAML",
"description": "Simple YAML support, provides only clean subset of yaml",

@@ -18,3 +19,3 @@ "homepage": "https://travetto.io",

"dependencies": {
"@travetto/base": "^1.0.0-rc.8"
"@travetto/base": "^1.0.0"
},

@@ -31,4 +32,4 @@ "license": "MIT",

},
"version": "1.0.0-rc.9",
"gitHead": "cbb74e652d4277ec98c98098b931d6503a586af2"
"version": "1.0.0",
"gitHead": "7579e30893669f4136472c7d0a327a9cfdd1c804"
}

@@ -1,6 +0,100 @@

travetto: Yaml
===
<!-- This file was generated by the framweork and should not be modified directly -->
<!-- Please modify https://github.com/travetto/travetto/tree/master/module/yaml/README.js and execute "npm run docs" to rebuild -->
# YAML
## Simple YAML support, provides only clean subset of yaml
In the desire to provide a minimal footprint, the framework provides a minimal YAML parser/serializer to handle standard configuration structure.
**Install: @travetto/yaml**
```bash
npm install @travetto/yaml
```
[`YamlUtil`](./src/api.ts) is the main access point for this module, and will expose two method, `parse` and `serialize`.
In the desire to provide a minimal footprint, the framework provides a minimal [YAML](https://en.wikipedia.org/wiki/YAML) parser/serializer to handle standard configuration structure.
[YamlUtil](https://github.com/travetto/travetto/tree/master/module/yaml/src/util.ts#L7) is the main access point for this module, and will expose two method, `parse` and `serialize`.
**Code: Simple YAML Parsing**
```typescript
import { YamlUtil } from '@travetto/yaml/src/util';
const obj = YamlUtil.parse(`
name: Source
age: 20
fields:
sub:
- a
- b
- c
sub2: [1,2,3]
sub3: {"k":5, "v":20}
`);
console.log(JSON.stringify(obj, null, 2));
```
**Terminal: Simple YAML Parsing**
```bash
$ alt/docs/src/parse.ts -r @travetto/boot/register alt/docs/src/parse.ts
{
"name": "Source",
"age": 20,
"fields": {
"sub": [
"a",
"b",
"c"
],
"sub2": [
1,
2,
3
],
"sub3": {
"k": 5,
"v": 20
}
}
}
```
**Code: Simple YAML Serialization**
```typescript
import { YamlUtil } from '@travetto/yaml/src/util';
const text = YamlUtil.serialize({
name: 'Source',
age: 20,
fields: {
sub: [
'a',
'b',
'c'
],
sub2: [1, 2, 3],
sub3: { k: 5, v: 20 }
}
});
console.log(text);
```
**Terminal: Simple YAML Serialization**
```bash
$ alt/docs/src/serialize.ts -r @travetto/boot/register alt/docs/src/serialize.ts
name: Source
age: 20
fields:
sub:
- a
- b
- c
sub2:
- 1
- 2
- 3
sub3:
k: 5
v: 20
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc