vamos

1.0.0-5 • Public • Published

vamos

Local Node.js in the browser

Experimental

npm i vamos

Run the local Node.js microservice

vamos

In a client app, import and use the vamos module to evaluate Node.js code, with access to some core Node.js modules.

import React from 'react'
import vamos from 'vamos'

export default class extends React.Component {
  state = {
    files: []
  }

  componentDidMount () {
    vamos.eval('fs.readdir(os.homedir())')
      .then(files => {
        this.setState({ files })
      })

    vamos.run('ls ~/')
      .then(stdout => {
        console.log(stdout)
      })
  }

  render () {
    const { files } = this.state

    return (
      <ul>
        {files.map(file => (
          <li key={file}>
            {file}
          </li>
        ))}
      </ul>
    )
  }
}

Run your application with any build setup.

Why

  • Alternative to Electron for certain tasks
  • Create command line applications with a web interface
  • Quickly build custom utilities without the overhead of a full desktop app

MIT License

Readme

Keywords

none

Package Sidebar

Install

npm i vamos

Weekly Downloads

5

Version

1.0.0-5

License

MIT

Unpacked Size

7.7 kB

Total Files

10

Last publish

Collaborators

  • jxnblk