Skip to content
Add to ChromeAdd to Edge Add to Home Screen

Comparison

NoSleep.js vs @awaketab/wake

NoSleep.js 0.12.0, its last release (16 December 2020), already calls the Screen Wake Lock API when the browser has it, and falls back to a hidden looping video when it doesn't. If it works for you, there is no emergency. @awaketab/wake takes the same first step, then tells your code what happened: seven states, and a reason with every change. It is an actively maintained alternative, MIT-licensed.

Sources checked Saturday, 26 September 2026 3 min read By Soubhik Biswas
On this page
  1. Side by side
  2. When NoSleep.js is better
  3. When @awaketab/wake is better
  4. The same job in code
  5. Honest limit
  6. Try it
  7. Questions
  8. Related

Side by side

When NoSleep.js was written, a silent video was the only way to keep most phones awake. The Screen Wake Lock API arrived in Chrome and Edge 84 (July 2020), Safari 16.4 (March 2023) and Firefox 126 (May 2024). For the API itself, see Screen Wake Lock API: a practical guide with error handling. Facts about NoSleep.js come from its source on GitHub. Rows marked Same are real ties.

What @awaketab/wake NoSleep.js 0.12.0
How it keeps the screen on Wake Lock API; a video fallback after a tap, only where the API is missing Wake Lock API if present; hidden looping video otherwise; a page-reload timer on very old iOS
With the tab hidden Same No No
Install Copy packages/wake from the repository; npm package coming soon The npm package nosleep.js
Platforms Browsers; returns an inert handle during server rendering Browsers
Status Seven states, with a change event carrying from, to, reason and advice isEnabled, a boolean
Asks again after the tab returns Yes, on both, controlled by reacquireOnVisible Yes, on visibilitychange and fullscreenchange
When the browser takes the lock back Moves to lost with a reason Logs a console message
Licence and price Same MIT, free MIT, free
Last release Source on GitHub; not yet published 0.12.0, 16 December 2020

When NoSleep.js is the better choice

It is a good library. In these cases we would send you there.

  1. It already works and you only show an on/off switch On current browsers it makes the same API call. Switching buys you status reporting, not a stronger lock.
  2. You need a package from npm today @awaketab/wake isn't published yet, and some teams can't vendor source.

When @awaketab/wake is the better choice

These are the jobs @awaketab/wake was built for.

  1. Your users see the status A kiosk or dashboard that says "awake" should only say it while the lock holds. held means a live lock, and fallback means the video is really playing.
  2. You need to know why it failed A missing allow="screen-wake-lock" on an iframe, a hidden page and an http origin each get their own advice code.
  3. You use a framework @awaketab/wake/react, /preact and /vue export a useWakeLock() hook that returns the state with request and release.

The same job in code

NoSleep.js:

nosleep.js
import NoSleep from 'nosleep.js';const noSleep = new NoSleep();startButton.addEventListener('click', () => {  noSleep.enable().catch((err) => console.warn(err.name));});stopButton.addEventListener('click', () => noSleep.disable());

@awaketab/wake:

wake.ts
import { createWakeLock } from '@awaketab/wake';const lock = createWakeLock();lock.on('change', ({ from, to, reason, advice }) => {  console.log(`${from} -> ${to} (${reason})`, advice ?? '');});startButton.addEventListener('click', () => lock.request());stopButton.addEventListener('click', () => lock.release());

request() does not throw. It resolves with the resulting state: held when the browser grants the lock, fallback when the video is playing, denied or unsupported when neither worked. When a state changes for a reason you can act on, advice names it, for example hidden_document, permissions_policy, iframe_no_allow or insecure_context.

The @awaketab/wake library page has a live demo of every state.

Try it

Start a session, switch tabs, then come back and watch the pill.

Ready Suggested · 15 min
Starts when you open this tab
15:00

ends at

How AwakeTab knows

    Session complete

    Keeps awake for
    15:00
    ends at
    Keeps awake for
    15:00
    ends at of 15 min
    15:00
    ends at
    Keeps awake for
    15:00
    ends at

    Stopped to save battery

    Keeps this screen on while this tab stays visible.

    Ends Until you stop

    Type any time. A time that has already passed today means tomorrow.

    ends at

    How long?

    ends at

    Share this session

    Waits for a tap to start.Starts keeping the screen awake as it opens.

    Is AwakeTab doing its job?

    Your rating

    Time's up. Keep going?

    Settings

    How AwakeTab behaves. Every change saves as you make it.

    Timer Ask to extendJust stop · · Notifies youNo notification
    When time is up
    End sound Chosen in Customize, with the focus sounds.
    Clock Follow language12-hour24-hour · Seconds shownNo seconds · English
    Focus Pomodoro lengths, breathing and your intention
    Device and privacy Battery stop onBattery stop off · Shortcuts onShortcuts off · Usage data onUsage data off
    15%
    AwakeTab stops the session at this level.Turn on the switch above to choose a level.
    Pro Your plan and the devices it covers. See what's in Pro Manage devices
    Reset to defaults

    Every setting here goes back to its default. Your notes, stats and Pro stay.

    Version 2026.10.21 · d0ae7ca

    Customize

    Make it yours. Every change shows on the clock at once.

    Every face shows the same time and state. Swipe the clock or press C to switch faces.

    Classic

    Retro

    Modern

    Your stats

    This week
    Today
    Streak
    All time

    time awake per day

    Pro keeps 12 weeks of history. See what's in Pro

    Keyboard shortcuts

    Shortcuts need a keyboard. Without one, the buttons on screen do the same things.

    Session

    Space
    Start or stop
    1 6
    Presets 15 min–4 h
    0
    Until I stop
    U
    Until a time
    Esc
    Close or stop

    Screen

    F
    Fullscreen
    C
    Next clock face (Shift+C goes back)
    D
    Cycle theme
    M
    Cycle ambient mode
    P
    Floating window

    Tools

    S
    Sounds
    N
    Notes
    T
    Focus timer
    B
    Breathing guide
    I
    What you're working on
    ?
    This overlay

    Press ? or Esc to close. Single-key shortcuts can be turned off in Settings.Single-key shortcuts can be turned off in Settings.

    AwakeTab Pro

    $12 a year

    • More themes, lamps and backgrounds
    • A sound mixer
    • More notes
    • A repeating Pomodoro
    • Message mode
    • 12 weeks of stats

    Keeping the screen awake stays free, with no ads on the awake screen.

    Clock

    Start a 15-minute session

    Questions

    Does NoSleep.js still work in 2026?

    On browsers with the Screen Wake Lock API, yes: version 0.12.0 calls navigator.wakeLock.request('screen') first. Its video path is only reached where the API is missing. We have not re-checked that video path on current iOS.

    Is @awaketab/wake a drop-in replacement for NoSleep.js?

    No. The calls differ: createWakeLock(), request() and release() instead of new NoSleep(), enable() and disable(). Moving over is a few lines, and in return you get change events you can show to your users.

    Why does the video fallback need a click?

    Browsers block video autoplay until the person has interacted with the page. If play() is refused, @awaketab/wake stays in the unsupported state and emits an error event, so call request() again from a click or tap handler.

    Can I use @awaketab/wake before the npm package is out?

    Yes. The source is MIT-licensed in the packages/wake folder of the AwakeTab repository on GitHub. Copy it into your project and build it with your own bundler. The npm package is coming soon.

    Soubhik Biswas

    Builds AwakeTab. Sources checked Saturday, 26 September 2026. About AwakeTab