1.1.7 • Published 7 months ago

basicthreads v1.1.7

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

Basic Threads

This is a JavaScript thread library that supports both node.js, typescript and web!

Node.js Installation

In terminal:

npm install basicthreads

In file:

const Thread = require("basicthreads");
// OR
import Thread from "basicthreads";


const thread = Thread(() => 2 + 2);

Web Installation

In file:

<script src="https://unpkg.com/basicthreads"></script>
<script>
    const thread = Thread(() => 2 + 2);
</script>

<!-- OR -->

<script type="module">
    import Thread from "https://unpkg.com/basicthreads/index.min.mjs";

    const thread = Thread(() => 2 + 2);
</script>

Click me to get more information about BasicThreads from our wiki!

Why use threads in first place?

Threads are vital for managing resource-intensive tasks in programming. Imagine having a large project where certain tasks, like extensive loops, could freeze the whole application if not handled properly. Threads come into play by enabling the execution of these tasks in separate threads, preventing the main thread from becoming unresponsive.

For example, when counting from one to a trillion, using threads allows you to split the task into smaller segments. Each thread independently works on its segment, making the overall process much faster compared to a single-threaded approach. By leveraging multiple threads, your application remains interactive and completes tasks efficiently, enhancing the user experience.

1.1.7

7 months ago

1.1.6

7 months ago

1.1.5

8 months ago

1.1.4

9 months ago

1.1.3

9 months ago

1.1.2

9 months ago

1.1.1

9 months ago

1.1.0

9 months ago

1.0.9

9 months ago

1.0.8

9 months ago

1.0.7

9 months ago

1.0.6

9 months ago

1.0.5

9 months ago

1.0.4

9 months ago

1.0.3

9 months ago

1.0.2

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago