Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Node.js Package Management

Node.js Package Management

Node.js には詳しくないけど Grunt などでしょうがなく使っている人向けの npm の話。

Shuhei Kagawa

February 19, 2015
Tweet

More Decks by Shuhei Kagawa

Other Decks in Programming

Transcript

  1. npm • npmjs.com • 12 ສ ύοέʔδɺ1754 ສμ΢ϯϩʔυ/೔ • ϓϩδΣΫτͷ

    package.json ͱ͍͏ϑΝΠϧʹґଘ ϞδϡʔϧΛهड़ɻ • npm install ͢ΔͱϓϩδΣΫτσΟϨΫτϦҎԼͷ node_modules ͱ͍͏σΟϨΫτϦʹΠϯετʔϧ͞ ΕΔɻ
  2. UNIX ఩ֶ Write programs that do one thing and do

    it well ؔ਺Ұݸ͚ͩͷϞδϡʔϧ΋݁ߏ͋Δɻ
  3. ґଘϞδϡʔϧͷࢦఆ • package.json ʹόʔδϣϯͱͱ΋ʹهड़ɻ • ϑΝδʔͳόʔδϣϯࢦఆ͕σϑΥϧτʢnpm install —saveʣɻ • ~1.2.3

    = 1.2.3 Ҏ্ 1.3.0 ະຬ
 ^1.2.3 = 1.2.3 Ҏ্ 2.0.0 ະຬ
 ^0.2.3 = 0.2.3 Ҏ্ 0.3.0 ະຬ • semver ͕ ݫີʹकΒΕ͍ͯΕ͹ breaking change ͸ͳ͍͸ ͣɾɾɾ • ΋ͪΖΜී௨ʹࢦఆ͢Δ͜ͱ͕Ͱ͖Δɻ