Skip to content

node:timers should also export promises as field like node:fs does #51237

Closed
@axkibe

Description

@axkibe

What is the problem this feature will solve?

Following example:

import fs from 'node:fs';
import fsPromises from 'node:fs/promises';
import timers from 'node:timers';
import timersPromises from 'node:timers/promises';
console.log( !!fs.promises );
console.log( !!fsPromises );
console.log( !!timers.promises );
console.log( !!timersPromises );

returns:

true
true
false
true

It should return 4x true. Its not a big deal, but a little cumbersome in case some code wants the promised and unpromised version.

What is the feature you are proposing to solve the problem?

also export promises into the field imported by 'node:timers'.

What alternatives have you considered?

The workaround is easy just
import timersPromises from 'node:timers/promises';
but it's inconsistent to node:fs

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues that request new features to be added to Node.js.timersIssues and PRs related to the timers subsystem / setImmediate, setInterval, setTimeout.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions