# jetpack-validation

> Validate a directory with a manifest for Firefox Addons using Jetpack and jpm

Latest version **0.0.7** (published 2016-09-21) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install jetpack-validation
pnpm add jetpack-validation
yarn add jetpack-validation
bun add jetpack-validation
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.0.7 |
| Published | 2016-09-21 |
| First published | 2014-07-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Jordan Santell |
| Maintainers | jsantell, kumar303 |
| Keywords | jetpack, addon, mozilla, firefox, addons, validation |

## Links

- npm: https://www.npmjs.com/package/jetpack-validation
- Repository: https://github.com/mozilla-jetpack/jetpack-validation
- Issues: https://github.com/mozilla-jetpack/jetpack-validation/issues
- npm.io page: https://npm.io/package/jetpack-validation

## Dependencies (3)

- [semver](https://npm.io/package/semver.md) ^5.3.0
- [resolve](https://npm.io/package/resolve.md) ^0.7.1
- [jetpack-id](https://npm.io/package/jetpack-id.md) 0.0.4

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.0.7 (latest) — 2016-09-21
- 0.0.6 — 2016-06-20
- 0.0.5 — 2015-08-28
- 0.0.4 — 2014-08-23
- 0.0.3 — 2014-07-11
- 0.0.2 — 2014-07-09
- 0.0.1 — 2014-07-09

## README

jetpack-validation
==================

[![Build Status](http://img.shields.io/travis/mozilla-jetpack/jetpack-validation.svg?style=flat-square)](https://travis-ci.org/mozilla-jetpack/jetpack-validation)
[![Build Status](http://img.shields.io/npm/v/jetpack-validation.svg?style=flat-square)](https://www.npmjs.org/package/jetpack-validation)

Validate a directory with a manifest for Firefox Add-ons using the [Jetpack/Add-on SDK](https://github.com/mozilla/addon-sdk/) and [jpm](https://github.com/mozilla/jpm).

## Install

```
npm install jetpack-validate --save
```

## Usage

The main export takes a path to a directory and returns an object containing properties that have error messages as values. Some should be showstoppers (invalid ID) and some should just be used as warnings (invalid semver version, only for use with npm).

```
var validate = require("jetpack-validation");

var errors = validate("/path/to/my/addon");

if (Object.keys(errors).length) {
  Object.keys(errors).forEach(function (key) {
    console.error("Found " + key + " error: " + errors[key]);
  });
} else {
  console.log("No errors found!");
}
```

## Validations

* **id**: Uses [jetpack-id](https://github.com/jsantell/jetpack-id) to ensure a proper ID for [AMO](https://addons.mozilla.org/en-US/firefox/). Manifest must contain either an `id` field, adhering to Mozilla's [Add-on manifest rules](https://developer.mozilla.org/en-US/Add-ons/Install_Manifests#id) as either a GUID or a domain (in the case of jetpack addons converted from the cfx tool), or just a valid `name` field, which works as identification in `jpm` addons, and is compatable with `npm`'s naming scheme.
* **main**: Ensures that the `main` entry in the manifest refers to a file that exists, or resolves to a file that exists (using node loading rules), or that there is an `index.js` file in the root.
* **title**: Ensures that the manifest contains either a `title` property to be displayed when using the addon, and falls back to the more strict `name` property.
* **name**: Validates that the `name` property is a valid name for use with `npm`.
* **version**: Validates that the `version` property is in proper [semver](http://semver.org) format, for use with `npm`, as Mozilla's [toolkit version format](https://developer.mozilla.org/en-US/docs/Toolkit_version_format) is much less strict.

## License

MIT License, Copyright (c) 2014 Jordan Santell

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