1.1.1 • Published 5 years ago

current-time-website v1.1.1

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

current-time-website

NPM version

For testing certain kinds of software, a website that displays the current time, arbitrary rounded.

Run your own

$ npm i -g current-time-website
...
$ current-time-website &
# server started at http://localhost:3000
$ opn http://localhost:3000

Use mine

Example running at https://time.hawkeworks.com/.

Can also do a cycle. Click on this link, then keep refreshing it. It should change its response every 3 seconds:

In test suites

const { create } = require('current-time-website')

...

test(async (t) => {
  const site = await create({
    port: 0,
    offset: Date.now() / 1000,
    units: 0.1,
    cycle: ['a', 'b', 'c']
  })
  let data

  data = await (await fetch(site.siteurl)).text()
  t.equal(data, 'a')
  await delay(100)
  data = await (await fetch(site.siteurl)).text()
  t.equal(data, 'b')

  
  await site.stop()
  t.end()
})
1.1.1

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago