runtime-context

are we in development or production

Usage no npm install needed!

<script type="module">
  import runtimeContext from 'https://cdn.skypack.dev/runtime-context';
</script>

README

runtime-context

are we in development or production. designed to work in both the browser and node. In node it just exports process.env.NODE_ENV while in the browser it'll assume production unless either localStorage.getItem('runtime-context') has a value or the url is localhost:3000 - localhost:3999. This is because in certain browsers you don't have a good way to tell it otherwise and those certain browsers only ever get used in production anyway.

Installation

With component, packin or npm

$ {package mananger} install jkroso/runtime-context

then in your app:

var context = require('runtime-context')

Running the tests

Just run make. It will install and start a development server leaving the tests waiting for you at