1.0.0-5 • Published 6 years ago

vamos v1.0.0-5

Weekly downloads
2
License
MIT
Repository
-
Last release
6 years ago

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