https://github.com/joellefkowitz/env-names
Resolve short environment aliases.
https://github.com/joellefkowitz/env-names
aliases environment resolve
Last synced: 3 months ago
JSON representation
Resolve short environment aliases.
- Host: GitHub
- URL: https://github.com/joellefkowitz/env-names
- Owner: JoelLefkowitz
- License: mit
- Created: 2021-04-02T18:48:55.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-06-27T18:56:05.000Z (about 2 years ago)
- Last Synced: 2024-10-04T21:41:22.217Z (over 1 year ago)
- Topics: aliases, environment, resolve
- Language: PureScript
- Homepage:
- Size: 225 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Env names
Resolve short environment aliases.



## Installing
```bash
spago install env-names
```
## Documentation
Documentation and more detailed examples are hosted on [Pursuit](https://pursuit.purescript.org/packages/purescript-env-names).
## Usage
Environment names often have aliases such as `development` and `dev`. This can lead to development code finding its way into production, for example:
`dangerous.js`
```js
if (process.env.NODE_ENV === "dev") {
...
} else {
console.log("Let's hope I'm fit for production");
}
```
```bash
> NODE_ENV=development node ./dangerous.js
"Let's hope I'm fit for production"
```
This package offers a preventative approach with parsers for common aliases:
```purs
> longEnv "dev"
"development"
> longEnv "development"
"development"
```
You can specify custom aliases too:
```purs
alias = (Alias "gulls" "seagulls")
> replaceShort "seagulls"
"gulls"
> replaceShort "gulls"
"gulls"
```
## Tooling
### Dependencies
To install dependencies:
```bash
yarn install
yarn spago install
```
### Tests
To run tests:
```bash
yarn spago test
```
### Documentation
To generate the documentation locally:
```bash
yarn spago docs
```
### Linters
To run linters:
```bash
yarn lint
```
### Formatters
To run formatters:
```bash
yarn format
```
## Contributing
Please read this repository's [Code of Conduct](CODE_OF_CONDUCT.md) which outlines our collaboration standards and the [Changelog](CHANGELOG.md) for details on breaking changes that have been made.
This repository adheres to semantic versioning standards. For more information on semantic versioning visit [SemVer](https://semver.org).
Bump2version is used to version and tag changes. For example:
```bash
bump2version patch
```
### Contributors
- [Joel Lefkowitz](https://github.com/joellefkowitz) - Initial work
## Remarks
Lots of love to the open source community!