# stateful-title

> Stateful title management.

Latest version **1.0.0** (published 2016-10-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install stateful-title
pnpm add stateful-title
yarn add stateful-title
bun add stateful-title
```

## 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 | 1.0.0 |
| Published | 2016-10-23 |
| First published | 2016-10-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | EGOIST |
| Maintainers | rem |
| Keywords | title, document |

## Links

- npm: https://www.npmjs.com/package/stateful-title
- Repository: https://github.com/egoist/stateful-title
- Homepage: https://github.com/egoist/stateful-title#readme
- Issues: https://github.com/egoist/stateful-title/issues
- npm.io page: https://npm.io/package/stateful-title

## Alternatives

- [@cantoo/pdf-lib](https://npm.io/package/@cantoo/pdf-lib.md) — 297.9K weekly downloads
- [datatables.net-buttons](https://npm.io/package/datatables.net-buttons.md) — 200.1K weekly downloads
- [@ckeditor/ckeditor5-export-pdf](https://npm.io/package/@ckeditor/ckeditor5-export-pdf.md) — 167.0K weekly downloads
- [scanbot-web-sdk](https://npm.io/package/scanbot-web-sdk.md) — 15.0K weekly downloads
- [@syncfusion/ej2-angular-pdfviewer](https://npm.io/package/@syncfusion/ej2-angular-pdfviewer.md) — 8.8K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2016-10-23

## README

# stateful-title

[![NPM version](https://img.shields.io/npm/v/stateful-title.svg?style=flat-square)](https://npmjs.com/package/stateful-title) [![NPM downloads](https://img.shields.io/npm/dm/stateful-title.svg?style=flat-square)](https://npmjs.com/package/stateful-title) [![Build Status](https://img.shields.io/circleci/project/egoist/stateful-title/master.svg?style=flat-square)](https://circleci.com/gh/egoist/stateful-title)

## Install

```bash
$ npm install --save stateful-title
```

## Usage

```js
const statefulTitle = require('stateful-title')

const title = statefulTitle('old title')

// set new title
title('new title')
// document.title => 'new title'

// reset to old title
title()
// document.title => 'old title'
```

## API

### statefulTitle(oldTitle, [set])

It returns a function which accepts a new title as the only parameter to set `document.title`. If no new title was specified it defaults to old title.

#### oldTitle

Type: `string`

Old document title.

#### set

Type: `boolean`  
Default: `false`

Set document.title to `oldTitle`.

## Contributing

1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :D

## License

[MIT](https://egoist.mit-license.org/) © [EGOIST](https://github.com/egoist)

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