Skip to content

Main content

Development: npm Scoped Name Components Tool

Split a conservative lowercase npm scoped package-name token into scope and package, excluding URLs, versions and registry lookup.

Loading tool…

Description

Split a restricted lowercase npm scoped package name.

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 a restricted lowercase npm scoped package name.

When to use this tool

Use Development: npm Scoped Name Components when checking the stated package, Cargo or container-reference component.

How to use the tool and how it works

  1. Enter name. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read result. Expand result to inspect the returned fields.

Split a restricted lowercase npm scoped package name. Require @scope/package with ASCII lowercase alphanumeric beginnings and subsequent lowercase digits/dot/underscore/hyphen, total length <= 214.1

Input fieldMeaning and unitsAccepted input
nameNameRequired. Text. Implementation limit: 8192 Unicode code points and 16384 UTF-16 code units.
Output fieldInterpretationReturned shape
resultReturned object; expand its named members below.Required. Object.
result.scopeScopeCalculated result member: string.
result.packageNamePackage NameCalculated result member: string.
json
{
  "input": {
    "name": "@example/widget"
  },
  "output": {
    "result": {
      "scope": "example",
      "packageName": "widget"
    }
  }
}

Limitations and assumptions

  • This is local syntax validation, not a registry lookup or all package-manager naming rules.
  • Outputs are nested inside result. 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

  1. Calculation and input contract: development/npm-scoped-name-components — tool.io

Similar or alternative tools