Skip to content

Create a default template for package replacements #425

@joaopedrodcf

Description

@joaopedrodcf

Hey guys,

Creating this thread so that we can dicussed about the issue that was closed #390 but I think we would all benefit from following a structured issue formula this also helps a bit with the why that we also have this issue: #187

With a template we could basically all walktrough the template and understand why we want to replace a certain project and shouldn't be difficult to fill all necessary information for exemplification I will start with last-char that I opened an issue before it would be something like you can see below:

# Last-char - Micro-utility

## Current module
- Name: last-char
- Npmx Link: https://www.npmx.com/package/last-char

## Proposed replacement
Choose one of the following depending on the replacement type.

### Native feature replacement:
- ID:
- MDN reference:

### Preferred package replacement:
- Name:
- Npmx Link:

### Micro utility replacement:
- Expression: `str.at(-1) / str[str.length - 1]`
- Reference: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/at


## 2. Why should this module be replaced?

Check all that apply.

- [ ] Package appears unmaintained
- [ ] Too many dependencies
- [ ] No TypeScript support / No @types package
- [ ] No ESM support / No Dual package
- [ ] Security or supply-chain concerns
- [ ] Better maintained alternative exists
- [x] Simpler implementation possible
- [ ] Other

Explanation:

Modern JavaScript already provides native ways to achieve the same result without adding a dependency.

## 3. Feature parity and compatibility

### Does the replacement cover the same core use case?

- [x] Fully
- [ ] Partially
- [ ] No

### Behavioral differences

`String.prototype.at(-1)` returns `undefined` if the string is empty, while some helper utilities may return an empty string depending on implementation.

### Migration notes

Before

```ts
import lastChar from "last-char"

lastChar(str)
```

After

```ts
str.at(-1)
```

Alternative for environments without `.at()` support:

```ts
str[str.length - 1]
```

### Runtime compatibility
Indicate when the replacement became available in runtimes.

`String.prototype.at()` is supported in modern runtimes.

- Node.js:  ≥ 16
- Browsers:
- Other runtimes (Deno, Bun, etc.):

For older environments a fallback using index access can be used.

# 4. Package characteristics

### TypeScript

- [] Built-in types
- [ ] External typings
- [ ] No types

### Module format

- [] ESM
- [] Dual ESM/CJS
- [x] CJS only

## Dependencies

Runtime dependency count:

```
0
```

The package has no runtime dependencies.


## 5. Maintenance signals

### Maintainer activity

- Last release date: February 2025
- Maintainer: IonicaBizau
- Recent commits: repository shows periodic updates


### Issues

- Open issues: very low
- Issue activity: minimal but expected due to the simplicity of the package


# 6. Ecosystem signals

### Adoption

Is the package used by known projects?

- [ ] Yes
- [ ] No
- [x] Unknown

### Downloads

Weekly downloads (approx):

```
~1k per week
```

### Documentation

- [x] Good documentation
- [ ] Minimal documentation
- [ ] Poor documentation

## 7. Evidence and references

Links:

- npmx page: https://www.npmx.com/package/last-char
- repository: https://github.com/IonicaBizau/last-char
- MDN String.at: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/at

# 8. Required confirmations

Before accepting the proposal the following should be verified:

- [x] Replacement fits the selected manifest type
- [x] Replacement is maintained or clearly stable
- [x] Replacement does not introduce major compatibility problems
- [x] Migration path is documented
- [x] No known critical security concerns

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions