You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

balrog-meta-htmlcomment

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

balrog-meta-htmlcomment

Extract metadata from files by looking at a leading comment!

0.0.1
latest
Source
npmnpm
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

balrog-meta-htmlcomment

Build Status

Extract metadata from files by looking at a leading comment!

Example

Input:

<!--
  title: How to eat food
  author: @brianloveswords
  sandwich: grilled cheese & tomato
  tags: pizza, taco, burrito
  date: 2013-10-28
-->

# How to eat food
Step 1: eat it up
Step 2: awesome

Output:

{
  title: 'How to eat food',
  author: 'Brian J Brennan',
  sandwich: 'grilled cheese & tomato',
  tags: [ 'pizza', 'taco', 'burrito' ],
  date: '2013-10-28'
}

Install

TODO: talk about balrog integration

$ npm install balrog-meta-htmlcomment

Usage

TODO: talk about balrog usage

var extract = require('balrog-meta-htmlcomment')

extract(content)

content should be either a string or a buffer. If it is a buffer, it will be converted to a string with .toString('utf8').

It's expected that the first non-whitspace string in content is <!-- on its own line. Every line after that will be treated like a <key>:<value> pair. Any whitespace at the beginning and end of the line will be trimmed, as well as any whitespace before and after the “:”.

A “tags” key will be represented in the metadata as an array, using the comma character (and any leading/trailing whitespace) as the separator to split the string. So something like tags: hey, you, guys would be represented as ['hey', 'you', 'guys'].

License

Simplified BSD License

Keywords

balrog

FAQs

Package last updated on 28 Oct 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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.