Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Node Meetup Malmö, March 2014
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Pelle Wessman
March 04, 2014
Programming
110
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Node Meetup Malmö, March 2014
Quick presentation on some good things to know about if one want to publish a package on npm
Pelle Wessman
March 04, 2014
More Decks by Pelle Wessman
See All by Pelle Wessman
Keeping Code From Failing
voxpelli
0
67
Smarta stilmallar
voxpelli
0
300
Smarta stilmallar
voxpelli
0
1k
Other Decks in Programming
See All in Programming
TechTown - Creating Composable Callables in Contemporary C++
rollbear
0
130
気持ちぃ〜角丸 Squircle
ryu1013
0
310
Railsバージョンを4倍にした話
optim
0
390
自サークルのIdPからログアウトできるようになるまで
taiseiue
1
140
APNsからLive Activityを開始する話
yumnumm
0
170
複雑なUIコンポーネントとの ⻑い付き合い⽅:波及するバグからテスト戦略を経て、安全な再設計へ
mixplace
0
420
すこし踏み込む CancellationToken
htkym
2
1.7k
[ハンズオン]AIへの指示だけで「五目並べ」を作ってみよう
satoshi256kbyte
1
380
Domain-Driven Transformation
hschwentner
2
2.3k
最近”作らせてる” ローカルAIアプリの話
akit37
0
470
JIS keyboard support in Omarchy
lef237
0
120
半永久的に提供し続けられるプライベートクラウドを目指して ― 利用者の認知負荷を抑えるAPI抽象化とハードウェア世代交代の基盤設計
tomokon
0
500
Featured
See All Featured
The World Runs on Bad Software
bkeepers
PRO
72
12k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
330
How STYLIGHT went responsive
nonsquared
100
6.3k
Side Projects
sachag
456
43k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
6
1.2k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.6k
Visualization
eitanlees
153
17k
How to train your dragon (web standard)
notwaldorf
96
6.9k
Designing Experiences People Love
moore
143
24k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
400
A designer walks into a library…
pauljervisheath
211
25k
Transcript
npm publishing by Pelle Wessman, @voxpelli
package.json the core of it all
CommonJS Based on the Packages/1.0 spec
npm is basically the registry and the registry client (developed
by Isaac Z. Schlueter – npm, Inc.)
Required fields • name – should be URL-safe! (and no
”js”, ”node”) • version – semantic please! http://semver.org/ 1.0.0 === Major.Minor.Patch version
Important field ”private”: ”true” if you don’t want to publish!
Info fields • description • repository • homepage • bugs
• author • (README.md – and please – a changelog somewhere!) • (http://npmjs.org/~ – your social media and geek media (IRC) links!)
Code fields • main – the one field that node.js
itself uses • directories – directories.lib / directories.example
Env fields • engines – should define ”node • engineStrict
Global module fields • preferGlobal – results in warning on
local install • bin / directories.bin • man / directories.man
Script fields • scripts – test / start / lots-of-fun-stuffs
• config – for the above scripts
dependencies
devDependencies
• bundledDependencies • optionalDependencies • peerDependencies
.npmignore Defaults to .gitignore + eg. .DS_Store, .git, npm-debug.log Good
for excluding tests, examples etc. from packages
Compiled modules… …stuff for them to – but lets save
that for another time
Commands for the publisher
npm publish npm publish or npm publish https://github.com/voxpelli/foo/archive/v0.2.5.tar.gz
npm publish —tag <foo> for prereleases, betas, alphas, dev-releases etc
npm install foo@dev
• npm deprecate – package or version range • npm
version <major,minor,patch,1.33.7>
npm link to use your module locally during development (…but
exclude the global npm folder from OS X Time Machine)
Other use cases Not just Node.js uses NPM, but also
Browserify, Ender.js etc.