LoginSignup
8
5

More than 5 years have passed since last update.

Composerとnpmの非公開パッケージのライセンス

Last updated at Posted at 2018-11-28

Composerやnpmパッケージを非公開にしたい場合は、パッケージのライセンスには何を指定すればよいのか調べたのでメモ。

Composer

Composer公式ドキュメントにはっきりと書いてあった。
Screen Shot 2018-11-28 at 11.06.55.png

compose.json
{
    "name": "pikanji/my-lib",
    "type": "library",
    "description": "foo bar",
    "license": "proprietary",
    "require": {
        "php": ">=5.6"
    }
}

npm

こちらもnpm公式ドキュメントに書いてあった。
Screen Shot 2018-11-28 at 11.13.18.png

間違って公開されないように "private": true も入れておくと良いみたい。

package.json
{
    "name": "my-lib",
    "description": "foo bar",
    "dependencies": {
        ...
    },
    "scripts": {
        "test": "echo \"Error: no test specified\" && exit 1"
    },
    "author": "pikanji",
    "license": "UNLICENSED",
    "private": true
}
8
5
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
8
5