Skip to content

Simple plugin for insomnia that tries to spot timestamp and add them to response as iso strings

License

Notifications You must be signed in to change notification settings

Nicoolai/insomnia-plugin-timestamp-expander

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

insomnia-plugin-timestamp-expander

Simple plugin for insomnia that tries to spot timestamp and add them to response as iso strings.

I was fed up with seeing timestamps that made no sense to me! This plugin tries to spot timestamps in json output and add a new property with the timestamp as an ISO string.

At the moment, it only really works on json output. 🤷

What does it actually do!?

When it spots a 10 or 13 characters long integer, it will attempt to parse it into a date object.
It will then add an extra property, after the triggering property, where it writes the date as ISO String.
The new property name will be the name of the triggering property, with _as_datetime appended to it.

Example

Here is a short example of what actually happens in your response.

Original json:

{
    "created_at": 1663846167
}

Modified by plugin:

{
    "created_at": 1663846167,
    "created_at_as_datetime": "2022-09-22T11:29:27.000Z"
}

About

Simple plugin for insomnia that tries to spot timestamp and add them to response as iso strings

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published