LoginSignup
1
0

More than 5 years have passed since last update.

使用しているnpmのバージョンとそのリリース時刻を表示するシェルスクリプト

Posted at

node_modules以下のパッケージのバージョンとそのリリース時間を表示させる雑シェル

#!/bin/bash

for f in `find ./node_modules -maxdepth 1 -type d | grep react-`; do
    v=`cat ${f}/package.json | jq -r .version`
    p=`echo ${f} | cut -d '/' -f 3`
    echo ${p}
    npm info ${p} time | grep "${v}" | tr -ds '}' ','
done

※ 上のは grep react- でフィルタ。

結果例

babel-preset-react-native
  '1.9.1': '2016-12-15T09:32:55.561Z'
eslint-plugin-react-native
  '2.1.0': '2016-11-17T18:46:08.523Z'
hoist-non-react-statics
  '1.2.0': '2016-06-17T17:52:35.684Z'
react-addons-create-fragment
  '15.4.2': '2017-01-06T20:15:37.051Z'
react-addons-perf
  '15.4.2': '2017-01-06T20:15:47.700Z'
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0