npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

time-log-poster-cli

v1.0.3

Published

The tool receives time log, process it and posts on e.g. Jira how much time was spent on specified tasks.

Downloads

1

Readme

Motivation

Have you ever felt tired with keeping track of your working time for each task and logging it in Jira? time-log-poster connects Jira with simple and power tool for logging time via CLI -Timetrap - Simple Time Tracking. It creates worklog entries in every Jira task that correspond to Timestrap's entry.

How to use it ?

Let's say we have following entries during a day :

t display -s  "Sep 07" -e "Sep 07"

outputs:

Timesheet: MyProject
    Day                Start      End        Duration   Notes
    Thu Sep 07, 2017   10:20:00 - 10:50:00   0:30:00
                       10:50:00 - 11:21:41   0:31:41    SSLP-1774-webpack-update
                       11:22:11 - 11:44:00   0:21:49    SSLP-1842
                       11:44:00 - 12:34:48   0:50:48    SSLP-1842
                       12:34:49 - 15:40:00   3:05:11    SSLP-1774-webpack-update
                       16:40:00 - 18:40:08   2:00:08    SSLP-1774-webpack-update
                                             7:19:37
    ----------------------------------------------------------------------------
    Total                                    7:19:37

Take a notice, that some entries have notes with Jira issue id (e.g. SSLP-1842). They are used by time-log-poster to find a jira tasks and create appropriate worklog entries.

Single line command moves above data into Jira,

t display -s  "Sep 07" -e "Sep 07" -fjson | time-log-poster

outputs:

Time without without tickets:  30m
Posting of 5h 37m to SSLP-1774 on Thu Sep 07 2017...
Posting of 1h 12m to SSLP-1842 on Thu Sep 07 2017...
Success posting SSLP-1774 : 5h 37m
Success posting SSLP-1842 : 1h 12m

Now two entries SSLP-1774 and SSLP-1842 have their worklog entries created.

How to install?

npm install -g time-log-poster-cli

Go to your home folder e.g.

cd ~

And create there a config file with name .time-log-poster.config.json.

Copy and paste following example content to your newly created file.

{
  "ticketRegex": "XXXX-[0-9]+",
  "jiraUrl": "https://jira.example.com",
  "authorizationToken": "Basic eW91cjpwYXNzd29yZA==="
}

You need to provide proper values for each configuration entry: ticketRegex, jiraUrl and authorizationToken. The two first are project specific, you should be able to easily find proper values on your own.

authorizationToken

The third - authorizationToken holds a value for basic access authorization. The tool uses it to make requests to Jira API.

You can create it easily by converting following text username:passowrd with Base64, e.g. by running following JS code (of course you need to replace username and password strings):

var b = new Buffer('username:password');
console.log(b.toString('base64'));

Ways of use

Passing json via pipe

t display -s  "Sep 07" -e "Sep 07" -fjson | time-log-poster

Passing json as an argument

time-log-poster "[{\"id\":139,\"note\":\"\",\"start\":\"2017-09-0710:20:00+0200\",\"end\":\"2017-09-0710:50:00+0200\",\"sheet\":\"SSLPortal\"}]"