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

yaml-front-matter

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yaml-front-matter - npm Package Compare versions

Comparing version 4.0.0-0 to 4.0.0-1

45

bin/js-yaml-front.js
#!/usr/bin/env node
var program = require('commander')
, jsYaml = require('../');
, yamlFront = require('../')
, package = require('../package.json');
program
.version('1.0.1')
.usage('[options] <file>')
.version(package.version, '-v, --version')
.usage('[options] <string>')
.option('-c, --content [name]', 'set the property name for the files contents [__content]')
.parse(process.argv);
.on('--help', function() {
console.log('');
console.log(' Examples')
console.log('');
console.log(' Basic');
console.log(' yaml-front-matter <yaml-front-matter>');
console.log('');
console.log(' Piping content from an input file to an output file')
console.log(' cat ./some/file.txt | yaml-front-matter > output.txt');
});
program.parse(process.argv);
if (program.args.length > 0) {
if (program.content) {
console.log(jsYaml.loadFront(program.args[0], { contentKeyName: program.content }));
} else {
console.log(jsYaml.loadFront(program.args[0]));
}
processData(program.args[0]);
} else {
var data = '';
process.stdin.on('readable', function () {
var chunk;
while (chunk = process.stdin.read()) {
data += chunk;
}
});
process.stdin.on('end', function () {
// There will be a trailing \n from the user hitting enter. Get rid of it.
// data = data.replace("\r\n", '\n');
processData(data);
});
}
function processData(data) {
process.stdout.write(JSON.stringify(yamlFront.loadFront(data,
{ contentKeyName: program.content || '__content' }), undefined, 2));
}

@@ -5,2 +5,12 @@ # Change Log

<a name="4.0.0-1"></a>
# [4.0.0-1](https://github.com/dworthen/js-yaml-front-matter/compare/v4.0.0-0...v4.0.0-1) (2018-02-27)
### Bug Fixes
* **cli:** Update cli to support latest version ([1f0bd9e](https://github.com/dworthen/js-yaml-front-matter/commit/1f0bd9e))
<a name="4.0.0-0"></a>

@@ -7,0 +17,0 @@ # [4.0.0-0](https://github.com/dworthen/js-yaml-front-matter/compare/v3.4.0...v4.0.0-0) (2018-02-27)

3

package.json

@@ -8,3 +8,3 @@ {

"module": "src/index.js",
"version": "4.0.0-0",
"version": "4.0.0-1",
"keywords": [

@@ -26,2 +26,3 @@ "yaml"

"browser-sync": "^2.11.1",
"commander": "^2.14.1",
"gulp": "^3.9.0",

@@ -28,0 +29,0 @@ "gulp-concat": "^2.6.0",

@@ -67,3 +67,3 @@ # Yaml Front Matter

```shell
$ npm install yaml-front-matter
$ npm install yaml-front-matter@next
```

@@ -70,0 +70,0 @@

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