0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

package.jsonのライブラリのライセンスを取得する

Posted at

Node.jsで使っているライブラリの一覧を取得してNext.jsのアプリのページとして表示する方法を見つけた。

ライセンスチェックというと、だいたいlicense-checkerの情報が出てくるけど、
この、license-report はマークダウン形式で出力できるのでなかなか便利。

ただ、URLの文字列がおかしいのはどこで情報とってきているんだろう。

Powershellが入っている環境で下記コマンドを実行すると、URLの表示が修正できる。

license-report --output=markdown --config license-report-config.json| % { $_ -replace 'git\+', '' -replace 'ssh://', '' -replace 'git://', 'https://' -replace 'git@', 'https://' } | Set-Content license.md
license-report-config.json
{
  "fields": [
    "department",
    "relatedTo",
    "name",
    "licensePeriod",
    "material",
    "licenseType",
    "link",
    "comment",
    "installedVersion",
    "author"
  ]
}

本番環境で使っているものだけ出力するオプションもあり、使い勝手は良さそう。
それはそれとして、使っているライブラリのライセンスをもとに、自分のアプリがどのライセンスで公開できるのか、とか、どういう利用制限があるのかをパッと教えてくれるアプリないのかな。

0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?