whoami
• Daijiro Wachi - @watilde
• Front/Back End Engineer
• interested in npm / V8 / flyjs
Slide 3
Slide 3 text
beta released
at 2015-06-25
Slide 4
Slide 4 text
Table of contents
•
Why npm@3?
•
notes
•
breaking changes
•
new features
•
v3.1 - v3.3: Minor updates
Slide 5
Slide 5 text
Why npm@3?
• converting the CLI to an API
• dependency tree realization
• improved support for Windows paths
• better error messages & reporting
• front-end tooling support
• nerf peerDependencies
• better CLI search
Slide 6
Slide 6 text
converting the CLI to an API
• ػೳతཁ͕ࡍݶͳ͘ಧ͕͘ɺnpmطʹߴػೳ
• APIͱͯ͠ఏڙͰ͖Εɺࣗ༝ʹΧελϚΠζՄೳ
• ͓·͚ʹɺnpmͷίʔυͷςετ͕͘͢͠ͳΔ
• npm cache & npm-registry-clientͷ࠶ઃܭ
• cache.jsͷίʔυɺnpmඇґଘɺmulti-registryαϙʔτ
• ΦϑϥΠϯϞʔυͷ࣮Λ༰қʹ͢Δ
Slide 7
Slide 7 text
dependency tree realization
• ਖ਼֬ͳΠϯετʔϧͷॱংΛอূ͢Δ
1. ΠϯετʔϧࡁΈͷpackageΛ֬ೝ
2. ϩʔΧϧͷnode_modulesͷޮతͳ࠷ऴΠϝʔδߏங
3. ࣮ࡍʹ࣮ߦ͠ͳ͖Ό͍͚ͳ͍ΞΫγϣϯͷϦετߏங
4. ΠϯετʔϧΛ࣮ߦ
• npm i -g npm͕ࣦഊͨ͠ࡍʹ͕ࣗফ͑ΔࣄނΛ͙
• ؆୯ͦ͏ʹݟ͑ͯɺ࣮ࡍͷϓϩηεඇৗʹෳࡶ
See also: https://docs.npmjs.com/cli/install#algorithm
Slide 8
Slide 8 text
improved support for Windows paths
• front-endπʔϧͷීٴʹΑΓɺWindowsͰnpm͕α
ϙʔτ͖͠Ε͍ͯͳ͍γʔϯ͕සൃ࢝͠Ίͨ
• plugin-basedͳπʔϧͷଟ͘ɺඇৗʹ͍ϑΝΠϧ
ύεΛཁٻ͢ΔΑ͏ʹͳ͖ͬͯͨ
• Windows Ͱɺ୯Ұύε࠷େ 260 จࣈ·Ͱ
• npm dedupeͰnode_modulesͷFlatԽΛਪਐ͖ͯͨ͠
͕ɺ͜ͷͷղܾͷͨΊʹେʹมߋ͕ඞཁ
• Flat, flat, flat!
• The multi-stage installer
• Install: it works different!
• Shrinkwraps: they are a-changin'!
• The Age of Progress (Bars)!
new features
• npm ping
• npm install —no-progress
• npm team
• npm access
• npm install —only=dev
v3.1 - v3.3: Minor updates
These features are from v2.13.0 and v2.14.0