A library to operate .lenv files - an alternative to .env files that uses : (colon-space) instead of = for key-value separation.
Available in both JavaScript and Rust!
.lenv files are configuration files similar to .env files, but with a different syntax:
# .env format (traditional)
GITHUB_TOKEN=gh_...
API_KEY=abc123
# .lenv format (this library)
GITHUB_TOKEN: gh_...
API_KEY: abc123
The key difference is the use of : separator, which aligns with links-notation format. If a key appears multiple times, the last value wins (rewrite semantics).
| Package | Language | Directory | Status |
|---|---|---|---|
| lino-env | JavaScript | ./js |
|
| lino-env | Rust | ./rust |
npm install lino-env# create .lenv file
echo "HELLO: World" > .lenv
# create index.js
echo "import linoenv from 'lino-env'; linoenv.config(); console.log('Hello ' + process.env.HELLO)" > index.js
# run
node index.jsOutput:
Hello World
import linoenv from 'lino-env';
linoenv.config();
console.log(`Hello ${process.env.HELLO}`);For full API documentation, see the JavaScript README (coming soon) or the source code.
Add this to your Cargo.toml:
[dependencies]
lino-env = "0.1"use lino_env::LinoEnv;
// Create and write a new .lenv file
let mut env = LinoEnv::new(".lenv");
env.set("GITHUB_TOKEN", "gh_abc123");
env.set("API_KEY", "my_api_key");
env.write().unwrap();
// Read an existing .lenv file
let mut env = LinoEnv::new(".lenv");
env.read().unwrap();
// Get a value
if let Some(token) = env.get("GITHUB_TOKEN") {
println!("Token: {}", token);
}For full API documentation, see the Rust README.
.lenv files use the following format:
- Key-value separator:
:(colon followed by space) - One key-value pair per line
- Empty lines and lines starting with
#are ignored - If a key appears multiple times, the last value wins (rewrite semantics)
- Values can contain spaces, colons, and other special characters
Example .lenv file:
# Configuration file
GITHUB_TOKEN: gh_abc123xyz
TELEGRAM_TOKEN: 054test456
# Values with special characters
URL: https://example.com:8080
MESSAGE: Hello World
lino-env/
├── js/ # JavaScript package
│ ├── src/ # Source code
│ ├── tests/ # Tests
│ ├── .changeset/ # Changeset configuration
│ ├── package.json # Package manifest
│ └── ...
├── rust/ # Rust package
│ ├── src/ # Source code
│ ├── tests/ # Tests (integration)
│ ├── changelog.d/ # Changelog fragments
│ ├── Cargo.toml # Package manifest
│ └── ...
├── scripts/ # Shared scripts
└── .github/workflows/ # CI/CD workflows
├── js.yml # JavaScript CI/CD
└── rust.yml # Rust CI/CD
- Node.js 20.x for JavaScript development
- Rust 1.70+ for Rust development
# JavaScript tests
cd js && npm test
# Rust tests
cd rust && cargo test# JavaScript
cd js && npm run lint && npm run format:check
# Rust
cd rust && cargo fmt --check && cargo clippyThe repository uses GitHub Actions for automated testing and publishing.
JavaScript Package: Uses NPM trusted publishing, which leverages OpenID Connect (OIDC) to enable secure publishing without long-lived tokens. This is configured on npmjs.com by adding the GitHub repository as a trusted publisher, and requires id-token: write permission in the workflow. No manual token configuration is needed in the repository.
Rust Package: Requires maintainers to configure the CARGO_TOKEN secret:
| Secret | Purpose | How to Obtain |
|---|---|---|
CARGO_TOKEN |
Publishing Rust package to crates.io | crates.io API tokens |
Both packages are automatically published when changes are merged to the main branch, if the version has been bumped.
This project is released into the public domain under The Unlicense.