> For the complete documentation index, see [llms.txt](https://postr-inc.gitbook.io/visi.js-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://postr-inc.gitbook.io/visi.js-docs/api-reference.md).

# Api reference

Below you can view the api reference of Visi.js

## Core

`lib()` -> import libraries supported by Visi

```json
{
    "usage":"lib(\"@tailwind/daisyui\")",
    "libraries":[
      "@tailwind/daisyui", 
      "@tailwind/core",
      "@tailwind/pluginName",
      "@react-bootstrap",
      "@mui/material",
      "@d3.js",
      "@chart.js",
      "@three.js",
      "@mastercss",
   
        "frameworls":{
           "@lit-js",
        },
 
      
      
    }
}

```

`require()` removed as of v1.4.8&#x20;

```javascript
let Component = require('./path/to/component')
```

Why remove require? - it was synchronously importing components which is slow and blocked the main thread, which caused slow downs.

`dispose()` Asynchronously import components&#x20;

```javascript
let [El, Setel] = useState(null)
dispose('./path/to/component', (Element) =>{
  Setel(Element)
  // do something with El
}, {props...} || null)

```

`ReactRouter()`

* bindRoot() -> set the root render element of the webpage
* root() -> set the initial route of the page

&#x20;  options: /:param/ -> set parameters in the route can be gotten using req.params.someparam!

&#x20;  options /?query -> set query param in the route can be gotten using req.query.somequery!

* get() -> get routes on request

&#x20;   options: /:param/ -> set parameters in the route can be gotten using req.params.someparam!

&#x20;   options /?query -> set query param in the route can be gotten using req.query.somequery!

* on() -> on route change requests

&#x20;      options: /:param/ -> set parameters in the route can be gotten using req.params.someparam!

&#x20;      options /?query -> set query param in the route can be gotten using req.query.somequery!

&#x20;    `Fs` -> Just like nodejs filesystem Visi has one for localstorage!

* write('path', 'data', true - set compressed to true to compress data)&#x20;
* read('/path/to/file', true - decompress the compressed data)
* exists('path') -> check if a path exists&#x20;
* mkdir('new\_path') -> make a new directory
* watch('file', (callback)=>{}) -> watch a file for changes
* rmrf('path') -> dangerous removes the full directory be careful!
* ls('path') -> list contents of directory
* cp('current', 'new') -> self explanatory
* pwd() -> returns root
* cd('path') -> set current\_directory to the directory of choice
* clear() -> way more dangerous than rmrf
* size('path') -> get the size of the path
* rename('something', 'something') -> useless does what cp does!

`contained` -> container system allowing isolated executions

* newContainer('someid') -> creates a new container
* run('somecode') -> execute js code
* exit('id') -> self explanatory
* onMessage() -> self explanatory

&#x20;    &#x20;
