# validate-note

> 🎼 Validates a note (scientific pitch notation) and throws errors if needed

Latest version **1.4.0** (published 2017-01-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install validate-note
pnpm add validate-note
yarn add validate-note
bun add validate-note
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.4.0 |
| Published | 2017-01-02 |
| First published | 2016-10-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=4.0.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Geoffrey Dhuyvetters |
| Maintainers | duivvv |
| Keywords | audio, note, scientific pitch, web audio, music, music theory |

## Links

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

## Recent versions

- 1.4.0 (latest) — 2017-01-02
- 1.3.2 — 2016-12-30
- 1.3.1 — 2016-12-30
- 1.2.9 — 2016-11-20
- 1.2.8 — 2016-11-16
- 1.2.6 — 2016-11-16
- 1.2.4 — 2016-11-12
- 1.2.3 — 2016-11-10
- 1.2.1 — 2016-11-10
- 1.1.2 — 2016-10-11
- 1.1.1 — 2016-10-11
- 1.1.0 — 2016-10-11
- 1.0.0 — 2016-10-09

## README

# validate-note

![Node](https://img.shields.io/node/v/validate-note.svg?style=flat-square)
[![NPM](https://img.shields.io/npm/v/validate-note.svg?style=flat-square)](https://www.npmjs.com/package/validate-note)
[![David](https://img.shields.io/david/duivvv/validate-note.svg?style=flat-square)](https://david-dm.org/duivvv/validate-note)
[![Travis](https://img.shields.io/travis/duivvv/validate-note/master.svg?style=flat-square)](https://travis-ci.org/duivvv/validate-note)
[![Coverage Status](https://img.shields.io/coveralls/duivvv/validate-note.svg?style=flat-square)](https://coveralls.io/github/duivvv/validate-note)
[![Gitmoji](https://img.shields.io/badge/gitmoji-%20😜%20😍-FFDD67.svg?style=flat-square)](https://gitmoji.carloscuesta.me/)

> 🎼 Validates a note (scientific pitch notation) and throws errors if needed

### Usage

```js

import validateNote from 'validate-note';

const note = validateNote('A#4');
console.log(note); // > { letter: 'A', signature: '#', octave: 4 }

```

### Installation

Install via [yarn](https://github.com/yarnpkg/yarn)

	yarn add validate-note (--dev)

or npm

	npm install validate-note (--save-dev)


### configuration

You can pass in extra options (➕ required, ➖ optional, ✏️ default)

```js

import validateNote from 'validate-note';

const note = validateNote('Bb4', {
  flatToSharp: true,
  maxOctave: 5,
  octave: true
});

console.log(note); // > { letter: 'A', signature: '#', octave: 4 }

```

➖ **maxOctave** ( Number ) ` ✏️ 8 `
<br/> 📝 max octave allowed

➖ **flatToSharp** ( Boolean ) ` ✏️ false `
<br/> 📝 convert flats (b) to sharps (#)

➖ **octave** ( Boolean ) ` ✏️ false `
<br/> 📝 octave is required
<br/> ℹ️ `A#` throws error, `A#3` is a valid note

### Builds

If you don't use a package manager, you can [access `validate-note` via unpkg (CDN)](https://unpkg.com/validate-note/), download the source, or point your package manager to the url.

`validate-note` is compiled as a collection of [CommonJS](http://webpack.github.io/docs/commonjs.html) modules & [ES2015 modules](http://www.2ality.com/2014/09/es6-modules-final.html) for bundlers that support the `jsnext:main` or `module` field in package.json (Rollup, Webpack 2)

The `validate-note` package includes precompiled production and development [UMD](https://github.com/umdjs/umd) builds in the [`dist` folder](https://unpkg.com/validate-note/dist/). They can be used directly without a bundler and are thus compatible with many popular JavaScript module loaders and environments. You can drop a UMD build as a [`<script>` tag](https://unpkg.com/validate-note) on your page. The UMD builds make `validate-note` available as a `window.validateNote` global variable.

### License

The code is available under the [MIT](LICENSE) license.

### Contributing

We are open to contributions, see [CONTRIBUTING.md](CONTRIBUTING.md) for more info.

### Misc

This module was created using [generator-module-boilerplate](https://github.com/duivvv/generator-module-boilerplate).

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