Giter Club home page Giter Club logo

wait's Introduction

wait - Awaitable Delay

Wait is a promise wrapped setTimeout. That's it. Use it for a nicer delay interface.

import wait from 'wait';

async function myAsyncFunction() {
  await wait(300);

  // do some stuff here
}

You can also use it as a simple sleep for your cli apps:

echo Hi
npx wait 2000 # Will pause execution for 2 seconds.
echo Bye

wait's People

Contributors

ealush avatar

Stargazers

MrDiro avatar Gabriel Luís Lopes avatar Ofir Stiber avatar Alfi Maulana avatar Alexander Nortung avatar Vyacheslav Aristov avatar  avatar Danny Tunney avatar yodalightsabr avatar Rajas Paranjpe avatar Milldogjm avatar Ilya avatar Oliver Sayers avatar Brandon Nozaki Miller avatar

Watchers

Brandon Nozaki Miller avatar James Cloos avatar  avatar  avatar

wait's Issues

SyntaxError: Cannot use import statement outside a module

@ealush when using
image
I get the below error in nodejs
image

When I add "type": "module" in package.json other things breaks
image

And when I use
image
everything works but as mentioned in readme - import wait from 'wait'; dosent work.

When I use it with live server on the browser side
image
I get this error.
image

I'm confused atm, could someone explain. Can this run on both nodejs and browser if using live server

What I'm doing wrong or right way to use it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.