Socket
Book a DemoInstallSign in
Socket

@cloudcannon/data-extractor

Package Overview
Dependencies
Maintainers
7
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cloudcannon/data-extractor

Parses content files to generate a dataset.

0.0.1
latest
Source
npmnpm
Version published
Weekly downloads
112
330.77%
Maintainers
7
Weekly downloads
 
Created
Source

Data Extractor

Parses content files to generate a dataset. The output is sent to stdout, ready to pipe into a file for another process to consume.

version badge downloads badge

Installation

npm install --global @cloudcannon/data-extractor

This gives you access to the data-extractor binary.

Usage

data-extractor <path> [options]

To print usage details:

data-extractor --help

Parses content files to generate a dataset.

Usage
  $ data-extractor <path> [options]

Options
  --recursive, -r  Search folders recursively
  --no-recursive,  Prevents search folders recursively (default)
  --extension, -e  Allowed extension(s) to parse (default: 'md')
  --selector,  -s  JSON path to the data you want to parse (required)
  --verbose        Prints more debugging information
  --help           Prints this usage information
  --version        Prints the current version

Examples
  $ data-extractor content/posts -r -s '$.categories'
  $ data-extractor content -e md -e html -s 'seo.title'

Examples

Create a file at data/categories.json containing the combined, unique values of categories from the front matter of each file at content/posts/**/*:

data-extractor content/posts -r -s '$.categories' > data/categories.json

Create a file at data/page-titles.json containing the combined, unique values of seo.title from the front matter of each Markdown and HTML file at content/*:

data-extractor content -e md -e html -s 'seo.title' > data/page-titles.json

Development

Install dependencies:

npm i

Run tests:

npm test
npm run test:watch
npm run test:coverage

Lint code:

npm run lint

Link this package locally to test it on a site folder, then run it within your site folder:

npm link
cd ../my-ssg-site
data-extractor

License

ISC

Keywords

cloudcannon

FAQs

Package last updated on 14 Feb 2023

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.