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

split-md

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

split-md

split up Markdown file into smallers files

  • 0.2.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

travis build version license semantic-release Commitizen friendly

split-md

NodeJS CLI that splits a Markdown file into smaller files based on a given delimiter. It's basically str.split(pattern) for .md files.

Install

$ npm install split-md

Useage

To use the CLI, type split-md followed by it's args:

  • readPath (path to larger .md file)
  • pattern (string)
  • cleanName (string): do you want to remove anything from the pattern?
  • writePath (path to where smaller files should be created)
  • limit (optionally limit the number of files created)
Example
$ split-md 'tests/testdata.md' '### v' '###' '' 10

In the above example we are reading in tests/testdata.md. Our delimiter is whenever we see a line start with the pattern ### v. We want to use this line for our new markdown file's name, however we want to remove the ### by setting it as the cleanName variable. Lastly, we are setting the writePath to our current working directory by giving an empty string as the last variable. Also note that we are setting our limit to only create 10 files before exiting.

License:

MIT License 2016-2018 © Andy Craze & contributors

Keywords

FAQs

Package last updated on 06 Jan 2018

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

  • 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