# extract-banner

> Extract a banner comment from a string of javascript.

Latest version **0.1.2** (published 2016-03-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install extract-banner
pnpm add extract-banner
yarn add extract-banner
bun add extract-banner
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2016-03-20 |
| First published | 2016-03-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Jon Schlinkert |
| Maintainers | jonschlinkert |

## Links

- npm: https://www.npmjs.com/package/extract-banner
- Repository: https://github.com/jonschlinkert/extract-banner
- Issues: https://github.com/jonschlinkert/extract-banner/issues
- npm.io page: https://npm.io/package/extract-banner

## Dependencies (2)

- [strip-bom-string](https://npm.io/package/strip-bom-string.md) ^0.1.2
- [strip-use-strict](https://npm.io/package/strip-use-strict.md) ^0.1.0

## Recent versions

- 0.1.2 (latest) — 2016-03-20
- 0.1.1 — 2016-03-20
- 0.1.0 — 2016-03-20

## README

# extract-banner [![NPM version](https://img.shields.io/npm/v/extract-banner.svg)](https://www.npmjs.com/package/extract-banner) [![Build Status](https://img.shields.io/travis/jonschlinkert/extract-banner.svg)](https://travis-ci.org/jonschlinkert/extract-banner)

> Extract a banner comment from a string of javascript.

## Install

Install with [npm](https://www.npmjs.com/):

```sh
$ npm install extract-banner --save
```

## Usage

Works for block and line comments.

```js
var extract = require('extract-banner');
```

**Heads up!**: banner comments may be preceded by only whitespace and/or `"use strict";` statements. Aside from those exceptions a banner comment must be the first thing in a string.

**Example**

```js
var fs = require('fs');
var extract = require('extract-banner');
var str = fs.readFileSync('fixtures/banner.js', 'utf8');
var banner = extract(str);
```

Results in:

```js
/**
 * extract-banner <https://github.com/jonschlinkert/extract-banner>
 *
 * Copyright (c) 2016, Jon Schlinkert.
 * Licensed under the MIT license.
 */
```

## Related projects

* [add-banner](https://www.npmjs.com/package/add-banner): Add a banner to a string. Banners are just Lo-Dash/underscore templates, if a custom one… [more](https://www.npmjs.com/package/add-banner) | [homepage](https://github.com/jonschlinkert/add-banner)
* [has-banner](https://www.npmjs.com/package/has-banner): Returns true if a file has a banner code comment. Used for linting. | [homepage](https://github.com/jonschlinkert/has-banner)
* [strip-banner](https://www.npmjs.com/package/strip-banner): Strip banners from code. | [homepage](https://github.com/jonschlinkert/strip-banner)
* [update-banner](https://www.npmjs.com/package/update-banner): Add or update a banner in a string. | [homepage](https://github.com/jonschlinkert/update-banner)
* [write-banner](https://www.npmjs.com/package/write-banner): Add a banner to any file. | [homepage](https://github.com/jonschlinkert/write-banner)

## Contributing

Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/extract-banner/issues/new).

## Building docs

Generate readme and API documentation with [verb](https://github.com/verbose/verb):

```sh
$ npm install verb && npm run docs
```

Or, if [verb](https://github.com/verbose/verb) is installed globally:

```sh
$ verb
```

## Running tests

Install dev dependencies:

```sh
$ npm install -d && npm test
```

## Author

**Jon Schlinkert**

* [github/jonschlinkert](https://github.com/jonschlinkert)
* [twitter/jonschlinkert](http://twitter.com/jonschlinkert)

## License

Copyright © 2016 [Jon Schlinkert](https://github.com/jonschlinkert)
Released under the [MIT license](https://github.com/jonschlinkert/extract-banner/blob/master/LICENSE).

***

_This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on March 20, 2016._

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