
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
@ayamejs/usage
Advanced tools
@ayamejs/usageParses usage strings like <target:user> [reason:string...] into a JavaScript object like [{ name: "target", type: "user", required: true, rest: false, options: null, literal: false }, { name: "reason", type: "string", required: false, rest: true, options: null, literal: false }]
Used internally by the Ayame Framework but anyone can use it.
Join our Discord Server for support and more.
$ npm install @ayamejs/usage
If you are using Ayame then ignore this, it's already a dependency of Ayame and is used internally, this guide is for interested users who would like to use them in their own custom bots.
TypeScript typings included.
const usage = require("@ayamejs/usage");
// Parse a usage string.
usage.parse("<target:user> [reason:string...]");
// =>
// [
// { name: 'target', type: 'user', required: true, rest: false, options: null, literal: false },
// { name: 'reason', type: 'string', required: false, rest: true, options: null, literal: false }
// ]
// Clean the types to make it more user friendly on discord.
// Use this e.g in your help command.
usage.format("<target:user> [reason:string...]");
// => <target> [reason...]
// Or if you have a seperator.
usage.format("<username:string> <repository:string>", "/");
// => <username> / <repository>
Explanations on each returned property:
<> meaning it is required.... meaning to parse the rest of the input. Only on the last tag.| seperator. Available on type union it would signify the user meant to try parsing as different types (<target:member|user> try parsing as member if failed try user)<action::add|remove|list> action can be either add, remove or list) This is true if the user used :: double colons to seperate the union.Instead of repeating the same name for the type we have some aliases.
e.g instead of <user:user> you can use <@user>
Aliases:
@ user@@ member# channelThe output format does not change, you can still treat it as if the full <user:user> was passed.
More aliases will be added if needed.
# prefix tags for channels.usage.format to make it clear to the user about the seperator.@ayamejs/usage is released under the terms of MIT LICENSE
FAQs
Usage tag parser for Ayame framework
We found that @ayamejs/usage demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.