---
id: node-apis
title: Using Node.js APIs
---

Flipper plugins should be designed to work inside browsers as well, as Flipper isn't guaranteed to be always running on top of Electron. 
For that reason it should be avoided to use Node.js APIs directly (e.g. modules like `fs`, `child_process`, `path`), 
or packages that depend on those. 

The most important Node APIs can be found by using `getFlipperLib()` (exposed by the `flipper-plugin` package). Please note that these APIs are all promisified.

* `fs`: Use `getFlipperLib().remoteServerContext.fs` instead.
* `child_process`: Use `getFlipperLib().remoteServerContext.childProcess.exec`. Note that this API is intended for short lived processes only.
* `path`: Use `import {path} from 'flipper-plugin'` instead.
* `os`: Use `getFlipperLib().environmentInfo.os` instead. 
  * For system specific directories like home, desktop, etc, use `getFlipperLib().paths.homePath` and alike. 

In the future, these APIs might be subject to further security / permission restrictions to sandbox plugins better.
