官术网_书友最值得收藏!

Finding npm packages

By default, npm modules are retrieved over the internet from the public package registry maintained on http://npmjs.com. If you know the module name, it can be installed simply by typing the following:

$ npm install moduleName  

But what if you don't know the module name? How do you discover the interesting modules? The website http://npmjs.com publishes a searchable index of the modules in that registry.

The npm package also has a command-line search function to consult the same index:

Of course, upon finding a module, it's installed as follows:

$ npm install acoustid  

After installing a module, you may want to see the documentation, which would be on the module's website. The homepage tag in package.json lists that URL. The easiest way to look at the package.json file is with the npm view command, as follows:

$ npm view akasharender
...
{ name: 'akasharender',
  description: 'Rendering support for generating static HTML websites 
or EPUB eBooks
', 'dist-tags': { latest: '0.6.15' }, versions: [ '0.0.1', ... author: 'David Herron <david@davidherron.com>

(http://davidherron.com)', repository: { type: 'git', url:
'git://github.com/akashacms/akasharender.git' }, homepage: 'http://akashacms.com/akasharender/toc.html', ... }

You can use npm view to extract any tag from package.json, like the following, which lets you view just the homepage tag:

$ npm view akasharender homepage
http://akashacms.org/akasharender/toc.html 

Other fields in the package.json can be viewed by simply giving the desired tag name.

主站蜘蛛池模板: 昌邑市| 万年县| 夏津县| 星子县| 哈尔滨市| 湖北省| 绥滨县| 宁安市| 萝北县| 安宁市| 宜阳县| 鹿邑县| 和龙市| 秦皇岛市| 阳谷县| 民勤县| 聊城市| 兴仁县| 古田县| 黄平县| 麻江县| 山阳县| 丰镇市| 赫章县| 安新县| 洛阳市| 乌海市| 广德县| 西宁市| 教育| 黎川县| 富顺县| 讷河市| 莲花县| 通许县| 宁明县| 梧州市| 色达县| 城市| 刚察县| 六枝特区|