Description
Split scope and package under a restricted npm-style name grammar.
Package and container references combine names, selectors, conditions and platform metadata. A restricted lexical split can preserve these parts without validating registry identity, available targets, dependency graphs or runtime resolution.
Split scope and package under a restricted npm-style name grammar.
When to use this tool
Use npm Package Name Scope Boundary when checking the stated package, Cargo or container-reference component.
How to use the tool and how it works
- Enter name. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read scope, package, scoped. Inspect scoped before interpreting the associated values.
Split scope and package under a restricted npm-style name grammar. Accept an optional lowercase @scope/ and a lowercase package component; unscoped names return empty scope.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| name | Name | Required. Text; maximum UTF-16 length 8192. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| scope | Scope | Required. Text; maximum UTF-16 length 8192. |
| package | Package | Required. Text; maximum UTF-16 length 8192. |
| scoped | Scoped | Required. Boolean. |
{
"input": {
"name": "@tool/example"
},
"output": {
"scope": "tool",
"package": "example",
"scoped": true
}
} Limitations and assumptions
- This predicate does not check total name length, registry restrictions or package existence.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
Alternative or Complementary methods
Use the relevant package manager, runtime or registry against the actual project for complete resolution and validation.
References
Similar or alternative tools
- npm Package Tag Selector Split
Split a package selector at its required name-selector boundary.
- Development: npm Scoped Name Components
Split a restricted lowercase npm scoped package name.