New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

libyaml

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

libyaml

Bindings to libYAML

  • 0.2.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
14
decreased by-80%
Maintainers
1
Weekly downloads
 
Created
Source

YAML.node Build Status

A simple binding for LibYAML.

Installing

$ npm install libyaml

Usage

var YAML = require('libyaml');

There's a basic JSON-like API:

var documents = YAML.parse('Hello world!');
var data = YAML.stringify({ fancy: ['object', 'structure'] });

And also a fs-like API:

YAML.readFile('myfile.yml', function(error, documents) {
  /* ... */
});

var doc1 = { first: 'document' };
var doc2 = { another: 'doc' };
YAML.writeFile('myfile.yml', doc1, doc2, function(error) {
  /* ... */
});

Including synchronous variants:

var documents = YAML.readFileSync('myfile.yml');
YAML.writeFileSync('myfile.yml', doc1, doc2);

Hacking the code

git clone https://github.com/stephank/yaml.node.git
cd yaml.node
npm install
npm test

Upgrading from pre-0.1.0

As of 0.1.0, the API immitates the JavaScript built-in JSON parser for string handling, and the Node.js built-in fs-module for file I/O. Function names have changed as follows:

YAML.load ➞ YAML.parse
YAML.dump ➞ YAML.stringify

YAML.loadFile ➞ YAML.readFile
YAML.dumpFile ➞ YAML.writeFile

YAML.loadFileSync ➞ YAML.readFileSync
YAML.dumpFileSync ➞ YAML.writeFileSync

YAML.parse ➞ YAML.stream.parse

FAQs

Package last updated on 08 Mar 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