Bnlang Package Manager (BPM)
BPM is the official package manager for Bnlang. It manages two files in your project:
bnl.json— the project manifest: name, version, dependencies, main entry point.bnl.lock— a generated lockfile pinning every direct and transitive dependency to a concrete version + integrity hash.
Packages install into a local ./deps/ folder by default (or ~/.bnl/deps with -g). Native plugins (.dll / .so / .dylib) install the same way — see Plugin development.
Installing BPM
BPM ships alongside Bnlang. Confirm with:
bpm --version
Common Commands
bpm init→ Create a starterbnl.jsonin the current directory.bpm install→ Install every dependency declared inbnl.json.bpm install <name>[@version]→ Add and install one package.bpm install -g <name>→ Install globally into~/.bnl/deps.bpm uninstall <name>→ Remove an installed dependency.bpm list→ Show installed packages.bpm login→ Authenticate with the registry.bpm publish→ Publish the current package to the registry.
Example Workflow
# Start a new project
mkdir my-app && cd my-app
bpm init
# Add a dependency
bpm install some-package
# Or install everything from bnl.json (e.g. on a fresh checkout)
bpm install
# Remove what you don't need anymore
bpm uninstall some-package
# Publish your own package
bpm login
bpm publish
Using an Installed Package
Installed packages live under ./deps/. Import them by name — the import resolver knows where to look.
import "some-package" as pkg;
print(pkg.hello());
Best Practices
- Commit both
bnl.jsonandbnl.lock. The lockfile is what makes other people's installs reproduce yours. - Use semantic version ranges (
^1.2.3) inbnl.jsonfor direct deps so patch releases flow in naturally. - Use
-gsparingly — global installs are great for CLIs you want on PATH, less great for app dependencies. - Give packages clear, lowercase names and document the public API in a README.