
Security News
The Nightmare Before Deployment
Season’s greetings from Socket, and here’s to a calm end of year: clean dependencies, boring pipelines, no surprises.
Processto uses globby to process directories of markdown and yaml files to a mirrored tree of JSON files. Additionally, with the convertMode: "source" option you can convert back from json to the input markdown and yaml files. This is mostly useful for blogs or static content for websites or other places where json is used but the readability of yaml is useful.
Install with npm
npm install --save-dev processto
You can then use the cli
processto "content/**/*.{yml,md}" --outputDir output
And watch files to automatically recompile them.
processto "content/**/*.{yml,md}" --outputDir output --watch
With an input markdown file such as this:
---
test: frontmatter
draft: true
num: 1
---
# processto
Process a directory of markdown *and* yaml files to JSON files
This would be the resulting JSON:
{
"test":"frontmatter",
"draft":true,
"num":1,
"bodyContent":"# processto\r\n\r\nProcess a directory of markdown *and* yaml files to JSON files",
"bodyHtml":"<h1 id=\"processto\">processto</h1>\n<p>Process a directory of markdown <em>and</em> yaml files to JSON files</p>\n",
"title":"processto",
"dir":"test/data/output",
"base":"frontmatter.json",
"ext":".json",
"sourceBase":"frontmatter.md",
"sourceExt":".md"
}
And given the following input directory:
.
├── L1
│ ├── L2
│ │ └── test2.yml
│ └── test.yml
├── README.md
└── frontmatter.md
It would produce this directory output:
.
├── L1
│ ├── L2
│ │ └── test2.json
│ └── test.json
├── README.json
└── frontmatter.json
Processto will also output some summary data as a json object to stdout when used with the --stdout option. Then you can direct that to a file.
processto \"content/**/*.{yml,md}\" --stdout --outputDir output > summary.json
summary.json will contain:
{
"fileMap":{
"test/data/output/frontmatter.json":"{...}",
"test/data/output/L1/test.json":"{...}",
...
}
"sourceFileArray":[
"test/data/input/frontmatter.md",
"test/data/input/L1/test.yml",
...
}
module.exports = {
// The directory output will be processed to.
outputDir: './dist',
// Watch mode, recompile on file changes.
watch: false,
// Prefix for output filenames, default is no prefix, just the original filename.
filenamePrefix: '',
// For markdown files how many characters should be included in an add `preview` property. 0 for no preview.
preview: 0,
// Include the markdown document title as `title` on the resulting json objects.
includeTitle: true,
// Include the directory as `dir` on the resulting json objects.
includeDir: true,
// Include the filename (.json) as `base` on the resulting json objects.
includeBase: true,
// Include the extension (.json) as `ext` on the resulting json objects.
includeExt: true,
// Include the source filename (.md / .yml) as `sourceBase` on the resulting json objects.
includeSourceBase: true,
// Include the source extension (.md / .yml) as `sourceExt` on the resulting json objects.
includeSourceExt: true,
// Convert mode. Possible options for this are 'json' or 'source'.
convertMode: 'json',
// Whether to output to stdout or not.
stdout: false,
// Custom markdown renderer function, null to use the default: `marked`.
markdownRenderer: null,
}
Enjoy!
FAQs
Process a directory of markdown and yaml files to JSON files
The npm package processto receives a total of 22 weekly downloads. As such, processto popularity was classified as not popular.
We found that processto 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
Season’s greetings from Socket, and here’s to a calm end of year: clean dependencies, boring pipelines, no surprises.

Research
/Security News
Impostor NuGet package Tracer.Fody.NLog typosquats Tracer.Fody and its author, using homoglyph tricks, and exfiltrates Stratis wallet JSON/passwords to a Russian IP address.

Security News
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.