npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@mp5maker/camfsp

v1.0.43

Published

This will combine all the markdown in a specific folder to a single PDF

Downloads

64

Readme

Combine all markdowns in a folder to a single pdf (camfsp)

This will combine all the markdown in a specific folder to a single PDF

  • Just mention the folder, it will recursively select all the markdowns file with (.md) extension only
  • Node.js (ESM and CommonJS) - 18.x, 19.x, 20.x

How to use

npx @mp5maker/camfsp convert --input [folder-src] --output [file-name]

[!CAUTION] Sometimes npx do not have the share module

  • Windows
    • For windows machine, use git-bash or similar
  • Linux

[!TIP] Please use the installation process instead, if direct npx do not work

[!CAUTION] Try to avoid node_modules folder

Installation

npm install @mp5maker/camfsp

Add it to the scripts (package.json)

"generate": "npx @mp5maker/camfsp convert --input [folder-src] --output [file-name]"
  • It can be any script name (up to you)

Run the script

npm run generate
  • npm run [your-script-name]

Example: Convert

  • Available Options:

    • input (Required): Folder name
    • output (Required): File name (".pdf")
    • extension (Optional): pdf option will combine all pdfs to one pdf
  • If your terminal is in root folder

npx @mp5maker/camfsp convert --input src --output documents.pdf
└── root/
    ├── index.tsx
    ├── topSection.scss
    ├── topSection.test.tsx
    ├── topSection.stories.tsx
    └── src/
        ├── index.tsx
        ├── hello.md
        ├── doe.md
        ├── nested-folder/
        │   ├── nice.md
        │   ├── nice.tsx
        │   └── nice.py
        └── try-another-folder/
            ├── .gitkeep
            └── world.md

This collect the markdowns the way it is structured in vscode

  1. hello.md
  2. doe.md
  3. nice.md
  4. world.md

Example: Convert (Extension: PDF)

  • If your terminal is in root folder
npx @mp5maker/camfsp convert --input src --output documents.pdf --extension pdf
└── root/
    ├── index.tsx
    ├── topSection.scss
    ├── topSection.test.tsx
    ├── topSection.stories.tsx
    └── src/
        ├── index.tsx
        ├── hello.pdf
        ├── doe.pdf
        ├── nested-folder/
        │   ├── nice.md
        │   ├── nice.tsx
        │   └── nice.py
        └── try-another-folder/
            ├── .gitkeep
            └── world.pdf

This collect the markdowns the way it is structured in vscode

  1. hello.pdf
  2. doe.pdf
  3. world.pdf

Example: Collect

  • Available Options:

    • input (Required): Folder name
    • output (Required): File name (".pdf")
    • pick (Optional): Specific extensions to extract eg: ".py" ".ts"
    • search (Optional): The term that you are searching for eg: "import os"
    • cut (Optional): Long file names to more readable ones
      • eg: "/User/johndoe/src/hello.md" to "/src/hello.md"
      • by --cut "/User/johndoe"
  • Pick (By Default):

    • ".jsx"
    • ".tsx"
    • ".html"
    • "scss"
    • ".css"
    • ".js"
    • ".ts"
  • If your terminal is in root folder
npx @mp5maker/camfsp collect --input src --output documents.pdf --search "<Select" --pick ".js" ".tsx" --cut "root/src"
└── root/
    ├── index.tsx ("<Select, in the code")
    ├── topSection.scss
    ├── topSection.test.tsx
    ├── topSection.stories.tsx ("<Select, in the code")
    └── src/
        ├── index.tsx
        ├── hello.pdf
        ├── doe.pdf
        ├── nested-folder/
        │   ├── nice.md
        │   ├── nice.js ("<Select, in the code")
        │   └── nice.py
        └── try-another-folder/
            ├── .gitkeep
            └── world.pdf

This collect the markdowns the way it is structured in vscode

  1. index.tsx
  2. topSection.stories.tsx
  3. nice.js

Example: Summarize (Local AI)

This feature is only available if you have a local llm

  • This will collect all the markdown files and make a summary of it
  • Only supported from the models provided by Ollama
  • Available Options:

    • input (Required): Folder name
    • output (Required): File name (".pdf")
    • baseurl (Optional): by default, 'http://localhost:11434'
    • model (Optional): by default, 'llama3.1:latest'
    • quiz (Optional): by default, false
      • This will generate a quiz instead of summary
    • ask (Optional): by default, false
      • This will generate answers based on your question
    • Three modes (default, --ask, --quiz), cannot be combined
  • If your terminal is in root folder
npx @mp5maker/camfsp summarize --input src --output documents.pdf --baseurl "http://localhost:11434" --model "llama3.1:latest"

Example: Summarize (Local AI: Quiz)

This feature is only available if you have a local llm

  • This will collect all the markdown files and make a summary of it
  • Only supported from the models provided by Ollama
  • If your terminal is in root folder
npx @mp5maker/camfsp summarize --input src --output documents.pdf --baseurl "http://localhost:11434" --model "llama3.1:latest" --quiz

Example: Summarize (Local AI: Ask)

This feature is only available if you have a local llm

  • Check ollama list
  • If not present then pull it
ollama pull mxbai-embed-large
  • This will collect all the markdown files and make a summary of it
  • Only supported from the models provided by Ollama
  • If your terminal is in root folder
npx @mp5maker/camfsp summarize --input src --output documents.pdf --baseurl "http://localhost:11434" --model "llama3.1:latest" --ask "Tell me something interesting"

Recommendation (For organizing files)

  • Adding numbers with the markdown file name will organize the files better
└── root/
    ├── index.tsx
    ├── topSection.scss
    ├── topSection.test.tsx
    ├── topSection.stories.tsx
    └── src/
        ├── 01.hello.md
        ├── 02.doe.md
        ├── nested-folder/
        │   ├── 01-nice.md
        │   ├── 02-ok.md
        │   └── 03.more.md
        └── try-another-folder/
            ├── .gitkeep
            └── 01-world.md