Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@37bytes/environment-info

Package Overview
Dependencies
Maintainers
6
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@37bytes/environment-info

A set of utilities to enhance work with internal environments.

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
13
decreased by-31.58%
Maintainers
6
Weekly downloads
 
Created
Source

About

A set of utilities to enhance work with internal environments.

Installation

Run the following command to install the package:

npm install @37bytes/environment-info

Description

getEnvironmentInfo

A utility for retrieving information about the current application version and the current environment. When called, it returns a string.

It takes an object with the following fields as input:

ParamsTypeRequiredDescription
standstring+Stand name
versionstring-Current Application Version
commitHashstring-Current Commit
branchstring-Current Branch
isProductionboolean-Production Environment Indicator

If isProduction = true, the response will be in the form of: ${version}, otherwise, the utility will return a string in the form of: ${version}|${stand}; ${branch}#${commitHash}

Important: When determining whether it's a production environment, we use a list of internal environments, not a list of production environments.

const isProductionEnvironment = (envName: string) => {
    if (import.meta.env.DEV) {
        return false;
    }
    
    if (['test', 'stage'].includes(envName)) {
        return false;
    }
    
    return true;
}
startEnvironmentTitleWatcher

A utility for adding the stand name to the title of the browser tab. It takes one argument: standName: string

###Version History

1.0.2

  • readme updated

1.0.1

  • Initial release.

FAQs

Package last updated on 26 Sep 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc