npm基础入门
1. npm简介 先来看下官方介绍: npm makes it easy for JavaScript developers to share and reuse code, and it makes it easy to update the code that you’re sharing 大概的意思就是: npm 是一个包管理器,让 JavaScript 开发者分享、复用、更新代码更方便。 npm有两层含义:一层含义是Node的开放式模块登记和管理系统(存包系统),网址:https://www.npmjs.com/;另一层含义是Node默认的模块管理器,是一个命令行软件,可以用来安装、管理和发布Node模块。 我们考虑下,没有npm之前前端程序员的操作方式: 当项目需要jQuery,需要手动去 jQuery 官网下载 jQuery 当项目需要BootStrap ,手动去 BootStrap 官网下载 BootStrap 当项目需要Underscore ,手动去 Underscore 官网下载 Underscore ....... 当有了npm之后,这些事情都不需要我们手动去处理了,npm自动去帮我们处理,其主要思想就是使用npm来把这些代码集中到一起来管理。 买个服务器作为代码仓库(repository,也就是:https://www.npmjs.com/)