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

yaml-js

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yaml-js

Pure Javascript YAML parser, ported from PyYAML

  • 0.0.7
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is yaml-js?

The yaml-js npm package is a JavaScript library for parsing and stringifying YAML (YAML Ain't Markup Language) data. It allows developers to easily convert YAML data to JavaScript objects and vice versa, making it useful for configuration files, data serialization, and more.

What are yaml-js's main functionalities?

Parsing YAML to JavaScript Object

This feature allows you to parse a YAML string and convert it into a JavaScript object. The `load` method is used to achieve this.

const yaml = require('yaml-js');
const yamlString = 'name: John Doe\nage: 30';
const jsObject = yaml.load(yamlString);
console.log(jsObject);

Stringifying JavaScript Object to YAML

This feature allows you to convert a JavaScript object into a YAML string. The `dump` method is used to achieve this.

const yaml = require('yaml-js');
const jsObject = { name: 'John Doe', age: 30 };
const yamlString = yaml.dump(jsObject);
console.log(yamlString);

Other packages similar to yaml-js

FAQs

Package last updated on 14 Apr 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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