Skip to content

szymonkaliski/Neutron

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Neutron

Travis status AppVeyor status

Self-contained Node and NPM environment, useful for teaching and sketching.

Supports Windows and OSX.

What is it exactly?

Neutron brings download & run thinking to Node. It packages NPM, auto-detects and auto-installs dependencies, so you only need an editor to get started.

Neutron is based on Electron, so you get everything that Chrome and Node can give you! (1)

(1) native packages are sadly not supported right now, Neutron ships with ones I use for workshops often: serial-port, johnny-five and node-midi.

Why does it exist?

While Node setup might be easy for developers, its still far away from tools like Processing — "just brew it" doesn't really work if you're on Windows, or have no brew installed, or just don't want to waste few hours on tooling while teaching beginners workshops.

How do I use it?

  1. download binary from releases tab
  2. run it

You might want to look into examples for sample integrations with p5, three.js and regl.

API

Neutron ships with small API.

var neutron = require('neutron');

Build-in packages

Functions

  • neutron.getWindowSize() - returns { width, height } of the window
  • neutron.getContentSize() - returns { width, height } of the content (innerWidth, innerHeight)
  • neutron.setWindowSize(width, height) - allows you to set window size from code
  • neutron.isResizable() - returns true if window can be resized
  • neutron.setResizable(shouldBeResizable) - set window to be resizable or not
  • neutron.getPosition() - returns window position on screen { x, y }
  • neutron.setPosition(x, y) - sets window position on screen
  • neutron.isFullScreen() - returns true if window is fullscreened
  • neutron.setFullScreen(shouldBeFullScreen) - control window fullscreen status
  • neutron.openDevTools() - opens developer tools
  • neutron.closeDevTools() - closes developer tools
  • neutron.getDisplays() - returns displays as detected by electron docs
  • neutron.getElectronRemote() - returns require('electron').remote
  • neutron.getElectronWindow() - returns require('electron').remote.getCurrentWindow()

About

self-contained Node and NPM environment, useful for teaching and sketching

Resources

License

Stars

Watchers

Forks

Packages

No packages published