Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Environmentally-friendly application config for Ruby.
Prius helps you guarantee that your environment variables are:
$ gem install prius
# Load a required environment variable into the Prius registry:
Prius.load(:github_token)
# Use the environment variable:
Prius.get(:github_token)
# Load an optional environment variable:
Prius.load(:might_be_here_or_not, required: false)
# Load and alias an environment variable:
Prius.load(:alias_name, env_var: "HORRENDOUS_SYSTEM_VAR_NAME")
# Load and coerce an environment variable (or raise):
Prius.load(:my_flag, type: :bool)
You probably want to load
all your environment variables as your app starts,
so you catch config issues at boot time.
Environment variables need to be loaded into the Prius registry before being used. Typically this is done in an initialiser.
Prius.load(name, **options)
If an environment variable can't be loaded, Prius will raise one of:
MissingValueError
if the environment variable was expected to be set but couldn't be found.TypeMismatchError
if the environment variable wasn't of the expected type (see below).Prius.load
accepts the following options:
Param | Default | Description |
---|---|---|
required | true | Flag to require the environment variable to have been set. |
type | :string | Type to coerce the environment variable to. Allowed values are :string , :int , :bool , and :date . |
env_var | name.upcase | Name of the environment variable name (if different from the upcased name ). |
Once a variable has been loaded into the registry it can be read using:
Prius.get(name)
If the environment variable hasn't been loaded, Prius will raise an UndeclaredNameError
.
To make running your app in test and development environments easier we recommend using Dotenv to automatically load a file of dummy config values.
GoCardless ♥ open source. If you do too, come join us.
FAQs
Unknown package
We found that prius demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.