Skip to content

kwak123/within-time

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

version-badge

Within Time

Within-Time was made to facilitate handling time constraints when running Node.js files. Really, it's because I got tired of using my fans as an indicator of a broken recursive function.

Usage

With how small and focused in scope Within-Time is, I'd advise using good ol' npx to handle it.

Recommended

npx within-time <path>

Global

Of course, sometimes it's nice to not have to write npx every time, or perhaps you want to alias for maximum convenience. In that case, install via yarn globally and you can simply run the command.

yarn global add within-time
within-time <file-name>

You can also pass relative paths to the file

within-time test/scenarios/doesNotClose.js
within-time ./test/scenarios/doesNotClose.js

You can also pass directory paths!

within-time test/scenarios

Upcoming

  • Nested directories
    • Will need to consider resource limits, given nature of child_process.fork
  • Configure time constraint via cli
  • Prettier outputting
  • Relevant examples?

About

Set time limits when running a Node.js file

Resources

License

Stars

Watchers

Forks

Packages

No packages published