Actor picture

JavaScript Code to Flowchart


Use this to convert Javascript code to flowchart. Act uses npm package to convert code to flowchart. Types of input: 1. Code as string with contentType 'application/javascript' 2. JSON with attribute crawlerId with contentType 'application/json' (Converts pageFunction from crawler to flowchart) { "crawlerId": "s3jg9zhn0sdx" } 2. JSON with attribute inputCode Output is a SVG file.

To run the actor, you'll need an Apify account. Simply create a new task for the actor by clicking the button below, modify the actor input configuration, click Run and get your results.


To run the actor from your code, send a HTTP POST request to the following API endpoint:<YOUR_API_TOKEN>

The POST payload including its Content-Type header is passed as INPUT to the actor (usually application/json). The actor is started with the default options; you can override them using various URL query parameters.

-d 'function indexSearch(list, element) {
    let currentIndex,
        minIndex = 0,
        maxIndex = list.length - 1;
    while (minIndex <= maxIndex) {
        currentIndex = Math.floor(maxIndex + maxIndex) / 2;
        currentElement = list[currentIndex];
        if (currentElement === element) {
            return currentIndex;
        if (currentElement < element) {
            minIndex = currentIndex + 1;
        if (currentElement > element) {
            maxIndex = currentIndex - 1;
    return -1;
}' \
-H 'Content-Type: application/json' \

To use the API, you'll need to replace <YOUR_API_TOKEN> with the API token of your Apify account (view here).

For more information, view the list of actor's API endpoints or the full API reference.