# codefolio

> A tool to help you show off your projects

Latest version **0.5.0** (published 2024-11-07) · ISC license · 0 weekly downloads

## Install

```sh
npm install codefolio
pnpm add codefolio
yarn add codefolio
bun add codefolio
```

## Health

**Score 40/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.0 |
| Published | 2024-11-07 |
| First published | 2020-04-25 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 10 |
| Unpacked size | 73.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | David Vedvick |
| Maintainers | davidvedvick |

## Links

- npm: https://www.npmjs.com/package/codefolio
- npm.io page: https://npm.io/package/codefolio

## Dependencies (10)

- [jsdom](https://npm.io/package/jsdom.md) ^25.0.1
- [unified](https://npm.io/package/unified.md) ^11.0.3
- [remark-gfm](https://npm.io/package/remark-gfm.md) ^4.0.0
- [remark-parse](https://npm.io/package/remark-parse.md) ^11.0.0
- [unified-stream](https://npm.io/package/unified-stream.md) ^3.0.0
- [unist-util-find](https://npm.io/package/unist-util-find.md) ^3.0.0
- [remark-stringify](https://npm.io/package/remark-stringify.md) ^11.0.0
- [unist-util-remove](https://npm.io/package/unist-util-remove.md) ^4.0.0
- [mdast-util-phrasing](https://npm.io/package/mdast-util-phrasing.md) ^4.0.0
- [mdast-squeeze-paragraphs](https://npm.io/package/mdast-squeeze-paragraphs.md) ^6.0.0

## Recent versions

- 0.5.0 (latest) — 2024-11-07
- 0.4.2 — 2023-11-03
- 0.4.1 — 2023-10-28
- 0.4.0 — 2023-10-28
- 0.3.0 — 2023-10-04
- 0.2.7 — 2023-10-03
- 0.2.6 — 2020-06-14
- 0.2.5 — 2020-06-14
- 0.2.4 — 2020-06-14
- 0.2.3 — 2020-06-14
- 0.2.1 — 2020-06-14
- 0.2.0 — 2020-06-09
- 0.1.0 — 2020-04-25

## README

# Codefolio

![logo](./folder-multiple-outline.svg)

Codefolio is a basic portfolio object builder for your projects.

## Features

- Follow simple conventions to produce a standard `Portfolio` object from a Markdown Readme.
- Or bring your own conventions, and just use Codefolio to produce standard `Portfolio` objects.

For example, given this markdown in a `README.md` file:

```markdown
# Hi I'm a level one heading

![img](./img.png)

Here's the body!
```

When passed into Codefolio:

```js
const codefolio = require('codefolio');


const portfolios = await codefolio.promisePortfolios(['README.md']);
```

Produces a `Portfolio` object like this:

```json5
{
  body: "# Hi I'm a level one heading\n\nHere's the body!",
  image: {
    url: "./img.png",
    alt: "img",
    title: "img"
  },
  examples: []
}
```

## Installation

```shell
npm install --save-dev codefolio
```

# Example Usage

Codefolio has a convention for reading a basic body and image from a project's README.md (or README.markdown, README):

- The first level one heading (`# Hi I'm a level one heading`) is where the body of the portfolio begins.
- The text after that heading is the body, until the **next** level one heading is hit - not including any images.
- The first image before the second level one heading in the document is considered the main image for the project.
- All other images before the second level are used as example images.

If following this convention, given this markdown in a `README.md` file:

```markdown
# Hi I'm a level one heading

![img](./img.png)

Here's the body!
```

When passed into Codefolio:

```js
const codefolio = require('codefolio');


const portfolios = await codefolio.promisePortfolios(['README.md']);
```

Produces a `Portfolio` object like this:

```json5
{
  body: "# Hi I'm a level one heading\n\nHere's the body!",
  image: {
    url: "./img.png",
    alt: "img",
    title: "img"
  },
  examples: []
}
```

# Contributing

Contributions to Codefolio are welcome. All pull requests must pass the automatic checks - and must be approved by the maintainer of the project. Please file issues and make feature requests through the issues UI at Github.

---
_Source: https://npm.io/package/codefolio · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
