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

quaff

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

quaff

Collect JSON/YAML/YML files from a source folder and convert them into a single object.

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

quaff Build Status

A data pipeline helper written in node that works similar to Middleman's Data Files collector.

Point the library at a folder filled with JSON and/or YAML files and get a JavaScript object back that reflects the folder's structure. Great for pulling data in to templates!

Under the hood it uses JavaScript's built in JSON support and js-yaml to read files.

Installation

npm install quaff --save-dev

Requires the latest iojs or node>=0.12.0.

Usage

Assume a folder with this structure.

data/
  mammals/
    cats.json
    dogs.json
  birds/
    parrots.yml

After require()'ing quaff:

var quaff = require('quaff');
var data = quaff('./data/');

console.log(data);

And the results...

{
  "mammals": {
    "cats": [
      "Marty",
      "Sammy"
    ],
    "dogs": [
      "Snazzy"
      "Cally"
    ]
  },
  "birds": {
    "parrots": {
      "alive": [
        "Buzz"
      ],
      "dead": [
        "Moose"
      ]
    }
  }
}

License

By Ryan Murphy.

Available under the MIT license.

Keywords

FAQs

Package last updated on 30 Mar 2015

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