Skip to content

[RRFC] Support relative dates in --before #844

@ericcornelissen

Description

@ericcornelissen

Motivation ("The Why")

My personal motivation is that I would like to be able to set the --before in the .npmrc configuration file of my project (with the goal of reducing the chances of pulling down malware under the assumption that third-parties continuously scan the registry for malware). However, I can also see this being a more convenient way to specify the value than having to compute and write out a date value (especially trying to decide in what order to specify the month/date/year).

Example

In an "ideal" world it could look something like:

npm install --before '2 days ago'

Perhaps more realistic is to provide a negative amount of days (or another precision):

npm install --before '-1'  # yesterday

How

Current Behaviour

The --before argument value should be a date.

Desired Behaviour

The --before argument can be a value relative to today's date.

References

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