
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.
@gpa/extract-params-from-path
Advanced tools
Extract path parameters from an express path specification using only the Typescript type system, to provide statically typed request parameters
Extract the parameters declared in an express path specification using the Typescript type system. Used to compute the list of available path parameters in a router in @gpa/type-safe-express.
The runtime path parameter parser of express is implemented in path-to-regexp, this library is compatible with:
@gpa/extract-params-from-path version | express version | path-to-regexp version |
---|---|---|
0.x | 4.0 -5.0.0-alpha.8 | 0.x |
1.x | 5.0.0-beta.1 -5.0.0-beta.3 | 3.2.0 (through router@2.0.0-beta.1 ) |
2.x | from 5.0.0 | 8.x (through router@2.0.0-beta.2 ) |
npm install @gpa/extract-params-from-path
Node.js >= 18
typescript >= 5.0 (optional)
import { ExtractParamsFromPath } from '@gpa/extract-params-from-path';
function router<Path extends string>(path: Path, handler: (request: { params: ExtractParamsFromPath<Path> }) => void) {}
router('/path/:pathParam', (req) => {
// req.params is { pathParam: string }
});
Type: string
The path to extract the parameters from.
FAQs
Extract path parameters from an express path specification using only the Typescript type system, to provide statically typed request parameters
We found that @gpa/extract-params-from-path 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.