
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
@loopfortress/capsule
Advanced tools
A tiny helper to load modules from files with validation for different export types:
It also provides a small directory lookup utility that walks up directories to find a file or directory (e.g., package.json).
JavaScript (ESM):
import { FunctionCapsule, ClassCapsule, ObjectCapsule, ModuleCapsule } from '@loopfortress/capsule'
const fnCap = new FunctionCapsule({ useDefault: true })
const fn = await fnCap.import('/abs/path/to/myFunc.mjs')
class Base {}
const classCap = new ClassCapsule(Base, { useDefault: true })
const ExportedClass = await classCap.import('/abs/path/to/myClass.mjs')
class Thing {}
const objCap = new ObjectCapsule(Thing, { useDefault: true })
const obj = await objCap.import('/abs/path/to/instance.mjs')
const moduleCap = new ModuleCapsule({ useDefault: true }, (exp) => exp && exp.ok ? false : 'missing ok')
const data = await moduleCap.import('/abs/path/to/data.mjs')
Lookup helper:
import { lookUp, lookUpSync } from '@loopfortress/capsule'
const found = await lookUp('package.json', { cwd: process.cwd() })
Create a .env
file with the following:
# Change these to match your user
DEV_UID=1000
DEV_GID=1000
Then run one of the following:
This repo uses Node's built-in test runner with assert.
Contributions are welcome! Feel free to open an issue or submit a pull request. Always ensure your contributions comply with the project's coding standards and pass validation.
This project is licensed under the MIT License. See the license file for details.
FAQs
Loop Capsule File Module Loader
We found that @loopfortress/capsule demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 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.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.