npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

pear-updates

1.1.0

@davidmarkclements

npmSnykSocket
Downloads:109
$ npm install pear-updates
DailyWeeklyMonthlyYearly

pear-updates

Pear platform and application update notifications

Usage

import updates from 'pear-updates'
const stream = updates()
stream.on('data', (update) => {
  const { app, version, info, updating, updated } = update
  //...
})
updates((update) => {
  const { app, version, info, updating, updated } = update
  //...
})

Pattern match against update properties to listen for specific kinds of updates:

const appUpdates = updates({ app: true })

appUpdates.on('data', (update) => {
  const { app, version, info, updating, updated } = update
  //...
})

const pearUpdates = updates({ app: false })

pearUpdates.on('data', (update) => {
  const { app, version, info, updating, updated } = update
  //...
})

const appUpdating = updates({ app: true, updating: true })

appUpdating.on('data', (update) => {
  const { app, version, info, updating, updated } = update
  //...
})

const pearUpdated = updates({ app: false, updated: true })

pearUpdated.on('data', (update) => {
  const { app, version, info, updating, updated } = update
  //...
})

License

Apache-2.0