{"id":25468002,"url":"https://github.com/peterleiva/node-environment","last_synced_at":"2026-05-08T01:41:13.526Z","repository":{"id":42636905,"uuid":"372630414","full_name":"peterleiva/node-environment","owner":"peterleiva","description":"Inspect NODE_ENV environment variable. Query for well known environment values","archived":false,"fork":false,"pushed_at":"2023-03-06T03:19:16.000Z","size":588,"stargazers_count":1,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-12T21:16:35.364Z","etag":null,"topics":["javascript","node-env","node-environment","nodejs","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/node-environment","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/peterleiva.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-05-31T21:15:37.000Z","updated_at":"2023-03-07T07:48:43.000Z","dependencies_parsed_at":"2023-07-22T06:43:17.718Z","dependency_job_id":"e7a32085-9dbb-437b-8ee7-950842d46752","html_url":"https://github.com/peterleiva/node-environment","commit_stats":null,"previous_names":["peterleiva/node-environment","pherval/node-environment"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterleiva%2Fnode-environment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterleiva%2Fnode-environment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterleiva%2Fnode-environment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterleiva%2Fnode-environment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peterleiva","download_url":"https://codeload.github.com/peterleiva/node-environment/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239430078,"owners_count":19637375,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javascript","node-env","node-environment","nodejs","typescript"],"created_at":"2025-02-18T07:36:56.844Z","updated_at":"2025-11-04T09:30:28.560Z","avatar_url":"https://github.com/peterleiva.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Code Style](https://github.com/pherval/node-environment/actions/workflows/code-style.yml/badge.svg)](https://github.com/pherval/node-environment/actions/workflows/code-style.yml) [![Publish to NPM](https://github.com/pherval/node-environment/actions/workflows/publish-npm.yml/badge.svg)](https://github.com/pherval/node-environment/actions/workflows/publish-npm.yml)\n\n# node-environment\n\nInspect or return the environment variable `NODE_ENV`\n\n## Requirements\n\n`node \u003e=12`\n\n## Features\n\n-   Consult `NODE_ENV` known values (`dev`, `development`, `production`, `prod`)\n-   Give `development` as default value\n-   Return the raw value from `NODE_ENV`\n-   All queries are case-insensitive\n\n## Installation\n\nInstall `node-environment` with npm\n\n```bash\n  npm install node-environment\n```\n\n## Usage/Examples\n\nUsing CommonJS modules\n\n```javascript\nconst { env } = require('node-environment')\n```\n\nUsing ECMAScript modules\n\n```javascript\nimport { env } from 'node-environment'\n```\n\n```javascript\nprocess.env.NODE_ENV = 'dev'\n\nenv('development') // true\nenv('staging', 'development') // true\nenv('test', 'production') // false\nenv() // \"dev\"\n```\n\n## API Reference\n\nThe package only expose one function:\n\n```javascript\n  env(): string\n  env(query: string, ...otherEnvironments: string[]): boolean\n```\n\n#### Aliases:\n\n`prod == production`\n\n`dev == development`\n\n## Contributing\n\nContributions are always welcome!\n\nSee `contributing.md` for ways to get started.\n\nPlease adhere to this project's `code of conduct`.\n\n## License\n\n[MIT](https://choosealicense.com/licenses/mit/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterleiva%2Fnode-environment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeterleiva%2Fnode-environment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterleiva%2Fnode-environment/lists"}