# validate-noddity-post

> Assert that a Noddity post file can be parsed by the butler, and rendered by Ractive.

Latest version **3.0.1** (published 2020-01-15) · WTFPL license · 0 weekly downloads

## Install

```sh
npm install validate-noddity-post
pnpm add validate-noddity-post
yarn add validate-noddity-post
bun add validate-noddity-post
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.1 |
| Published | 2020-01-15 |
| First published | 2016-10-27 |
| Weekly downloads | 0 |
| License | WTFPL |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | TehShrike |
| Maintainers | tehshrike |
| Keywords | noddity, lint, test, assert |

## Links

- npm: https://www.npmjs.com/package/validate-noddity-post
- Repository: https://github.com/TehShrike/validate-noddity-post
- Homepage: https://github.com/TehShrike/validate-noddity-post#readme
- Issues: https://github.com/TehShrike/validate-noddity-post/issues
- npm.io page: https://npm.io/package/validate-noddity-post

## Dependencies (1)

- [noddity-render-static](https://npm.io/package/noddity-render-static.md) 2.4.3

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@inrupt/eslint-config-base](https://npm.io/package/@inrupt/eslint-config-base.md) — 4.5K weekly downloads

## Recent versions

- 3.0.1 (latest) — 2020-01-15
- 3.0.0 — 2016-11-08
- 2.0.2 — 2016-11-08
- 2.0.1 — 2016-11-01
- 2.0.0 — 2016-11-01
- 1.0.1 — 2016-10-28
- 1.0.0 — 2016-10-27

## README

Validate noddity posts so that you can be guaranteed that their metadata is valid/parseable, and the contents can be rendered by the templating engine.

# API

[![Greenkeeper badge](https://badges.greenkeeper.io/TehShrike/validate-noddity-post.svg)](https://greenkeeper.io/)

```js
const Validator = require('validate-noddity-post')
const validate = Validator({
	butler,
	linkifier,
	data
})
```

`require` returns a constructor function:

## constructor({ butler, linkifier, data, [template] })

- butler: a [noddity-butler](https://github.com/TehShrike/noddity-butler)
- linkifier: [noddity-linkifier](https://github.com/TehShrike/noddity-linkifier)
- data: passed to [noddity-render-static](https://github.com/TehShrike/noddity-render-static)
- template: an optional post template

The constructor function returns a validator function:

## validator function(post)

Returns a promise that resolves with an object. If there is anything wrong with the post it will have an `error` property.

If the promise is rejected, then something is wrong with the universe, which is a distinct possibility when you're interacting with physical disks and internets and whatnot.

# Example

```js
validate('my-newest-post.md').then(({ error }) => {
	if (error) {
		console.log('your post sucks!', error)
	}
})
```

# License

[WTFPL](http://wtfpl2.com)

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