Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Node Meetup Malmö, March 2014
Search
Pelle Wessman
March 04, 2014
Programming
0
100
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
Tweet
Share
More Decks by Pelle Wessman
See All by Pelle Wessman
Keeping Code From Failing
voxpelli
0
57
Smarta stilmallar
voxpelli
0
290
Smarta stilmallar
voxpelli
0
970
Other Decks in Programming
See All in Programming
SourceGeneratorのマーカー属性問題について
htkym
0
210
ふつうのRubyist、ちいさなデバイス、大きな一年 / Ordinary Rubyists, Tiny Devices, Big Year
chobishiba
1
480
AI時代のシステム設計:ドメインモデルで変更しやすさを守る設計戦略
masuda220
PRO
6
1.1k
脱 雰囲気実装!AgentCoreを良い感じにWEBアプリケーションに組み込むために
takuyay0ne
3
370
Kubernetesでセルフホストが簡単なNewSQLを求めて / Seeking a NewSQL Database That's Simple to Self-Host on Kubernetes
nnaka2992
0
170
AI Assistants for Your Angular Solutions
manfredsteyer
PRO
0
150
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
770
条件判定に名前、つけてますか? #phperkaigi #c
77web
2
650
Claude Code Skill入門
mayahoney
0
410
Codex CLIのSubagentsによる並列API実装 / Parallel API Implementation with Codex CLI Subagents
takatty
2
200
「やめとこ」がなくなった — 1月にZennを始めて22本書いた AI共創開発のリアル
atani14
0
410
社内規程RAGの精度を73.3% → 100%に改善した話
oharu121
13
8.2k
Featured
See All Featured
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.8k
Crafting Experiences
bethany
1
92
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
150
Build your cross-platform service in a week with App Engine
jlugia
234
18k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.2k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
22k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
690
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
980
Deep Space Network (abreviated)
tonyrice
0
94
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
120
The SEO identity crisis: Don't let AI make you average
varn
0
420
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
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.