
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
An ergonomic env parsing library
bun add enya
Enya is an ergonomic env parsing library supercharged by Bun. Designed to be fast and with an extensive support for TypeScript.
Parsing your env from process.env.
import { e } from 'enya';
const env = e
.env({
DATABASE_URL: e.url(),
PORT: e.port().default(() => 8080),
})
.parse();
Now we can infer the type of the enviroment easily.
/**
* type Env = {
* DATABASE_URL: URL;
* PORT: number;
* }
*/
type Env = typeof env;
Enya was created with Bun, so you need to install it.
Install Bun with the command below:
curl -fsSL https://bun.sh/install | bash
powershell -c "irm bun.sh/install.ps1 | iex"
Then you can easily install Enya as a package.
bun add enya
bun add -d @types/bun
Enya lets you load your environment variables however you want, even though Bun already loads them automatically. For this, you can look at the example below:
import { e } from 'enya';
import { config } from 'dotenv';
/**
* {
* USER_EMAIL: string;
* PORT: number;
* }
*/
const env = e
.env({
USER_EMAIL: e.email(),
PORT: e.for({
production: e.never(),
development: e.number(),
}),
})
.parse(config());
console.log(env);
Enya has a great API for customizing each property of your environment variables which were not shown in the examples above, but you can find them in the documentation.
In a short period Enya will provide more support for customizations and more schemes.
Enya is supercharged by Bun and end-to-end type safety, being 80x faster than env-var and 7x faster than envalid. With an ergonomic and modern API.
FAQs
Unknown package
The npm package enya receives a total of 0 weekly downloads. As such, enya popularity was classified as not popular.
We found that enya demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.