
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
balrog-meta-htmlcomment
Advanced tools
Extract metadata from files by looking at a leading comment!
Extract metadata from files by looking at a leading comment!
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'
}
TODO: talk about balrog integration
$ npm install balrog-meta-htmlcomment
TODO: talk about balrog usage
var extract = require('balrog-meta-htmlcomment')
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']
.
Simplified BSD License
FAQs
Extract metadata from files by looking at a leading comment!
The npm package balrog-meta-htmlcomment receives a total of 1 weekly downloads. As such, balrog-meta-htmlcomment popularity was classified as not popular.
We found that balrog-meta-htmlcomment demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.