stateful-title

1.0.0 • Public • Published

stateful-title

NPM version NPM downloads Build Status

Install

$ npm install --save stateful-title

Usage

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 © EGOIST

Readme

Keywords

Package Sidebar

Install

npm i stateful-title

Weekly Downloads

3

Version

1.0.0

License

MIT

Last publish

Collaborators

  • rem