npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@startupjs/app

v0.54.16

Published

Router component for multi apps

Downloads

852

Readme

startupjs app

Router component for multi apps

Installation

yarn add @startupjs/app

Requirements

react: 16.9 - 17
react-native: >= 0.61.4 < 0.64.0
react-native-restart: >= 0.0.22
startupjs: >= 0.33.0

Critical Version

Add critical version info to your .env file in the root of your project.

If the version, specified on the server, stops matching the one in the client-side <App />, the user will be required to download an update from the app store.

CRITICAL_VERSION_IOS=1
CRITICAL_VERSION_ANDROID=1
CRITICAL_VERSION_WEB=1
UPDATE_LINK_ANDROID="market://details?id=company.example.app"
UPDATE_LINK_IOS="itms://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=0000000000&mt=8"
SUPPORT_EMAIL="[email protected]"

client

// Root/App.js

import App from 'startupjs/app'
import * as main from '../main'
import * as admin from '../admin'
import {
  CRITICAL_VERSION_IOS,
  CRITICAL_VERSION_ANDROID,
  CRITICAL_VERSION_WEB,
  UPDATE_LINK_ANDROID,
  UPDATE_LINK_IOS,
  SUPPORT_EMAIL
} from '@env'
import { useHistory } from 'react-router-native'


  const CustomError = ({ error, supportEmail }) => {
    const history = useHistory()
    return(
      <Div>
        <Span>{error.code} Error</Span>
        <Span>{error.message}</Span>
        <Button onPress={() => history.goBack()}>Go back</Button>
      </Div>
    )
  }

return (
  <App
    apps={{ main, admin }}
    criticalVersion={
      ios: CRITICAL_VERSION_IOS,
      android: CRITICAL_VERSION_ANDROID,
      web: CRITICAL_VERSION_WEB
    }
    supportEmail=SUPPORT_EMAIL
    androidUpdateLink=UPDATE_LINK_ANDROID
    iosUpdateLink=UPDATE_LINK_IOS
    useGlobalInit={() => {
      // A function that is called once each time the application is started
    }}
    goToHandler={(url, options, goTo) => {
      // Callback that will be processed every time before going to url. You must pass the third argument `goTo`. You need to be sure to call goTo in your goTo handler with the final url.
    }}
    errorPages={
      404: CustomError,
      ...,
    } // Takes an object in the format {
      //   error status number: Component that will be rendered
      //   ...,
      // }
  />
)

Display an error

You can change the error page to your own by passing an object of the following structure to the errorPages property:

  • ERROR_KEY (Component): specific page for ERROR_KEY
  • default (Component): the page that will be used when there is no specific page for the ERROR_KEY

Component will invoke with next props:

  • supportEmail: supportEmail from
  • error: The entity of throwed error (object {code, message})

To show an error page, use emit('error', { ERROR_KEY, message }), where ERROR_KEY is the unique identifier of the error. To hide an error page when the error occurred, use emit('error') (it is equivalent to emit('error', '')).

import App, { ErrorTemplate } from 'startupjs/app'
// ...some imports

const NewError= () => {
  return(
    <ErrorTemplate
      title={'405: My custom error'}
      description={'My custom description'}
    ></ErrorTemplate>
  )
}

return (
  <App
    //...some props
    errorPages={
      405: NewError
    }
  />
)

server

Add critical version info to your config.json file in the root of your project. This file will hold the critical version info of your application.

{
  "CRITICAL_VERSION_IOS": 1,
  "CRITICAL_VERSION_ANDROID": 1,
  "CRITICAL_VERSION_WEB": 1,
}
// server/index.js

import startupjsServer from 'startupjs/server'
import { initApp } from 'startupjs/app/server'
import conf from 'nconf'

startupjsServer({
  // ...
},
(ee, options) => {
  initApp(ee, {
    ios: conf.get('CRITICAL_VERSION_IOS'),
    android: conf.get('CRITICAL_VERSION_ANDROID'),
    web: conf.get('CRITICAL_VERSION_WEB')
  })
})

Licence

MIT

(c) Decision Mapper - http://decisionmapper.com