index.html 89 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width,initial-scale=1">
  6. <title>npm packageJson属性详解 | 彪哥博客</title>
  7. <meta name="generator" content="VuePress 1.9.5">
  8. <link rel="icon" href="/blog/img/favicon.ico">
  9. <meta name="description" content="web前端技术博客,专注web前端学习与总结。JavaScript,js,ES6,TypeScript,vue,React,python,css3,html5,Node,git,github等技术文章。">
  10. <meta name="keywords" content="前端博客,个人技术博客,前端,前端开发,前端框架,web前端,前端面试题,技术文档,学习,面试,JavaScript,js,ES6,TypeScript,vue,python,css3,html5,Node,git,github,markdown">
  11. <meta name="theme-color" content="#11a8cd">
  12. <link rel="preload" href="/blog/assets/css/0.styles.dc03b589.css" as="style"><link rel="preload" href="/blog/assets/js/app.5c136166.js" as="script"><link rel="preload" href="/blog/assets/js/2.c241a1b0.js" as="script"><link rel="preload" href="/blog/assets/js/3.6748bd5c.js" as="script"><link rel="preload" href="/blog/assets/js/54.dbb7c9ab.js" as="script"><link rel="prefetch" href="/blog/assets/js/10.cad3aa70.js"><link rel="prefetch" href="/blog/assets/js/100.1522ae22.js"><link rel="prefetch" href="/blog/assets/js/101.5c520ce5.js"><link rel="prefetch" href="/blog/assets/js/102.a0c8ea6b.js"><link rel="prefetch" href="/blog/assets/js/103.0e49cbad.js"><link rel="prefetch" href="/blog/assets/js/104.91a6aec1.js"><link rel="prefetch" href="/blog/assets/js/105.c39c4cd9.js"><link rel="prefetch" href="/blog/assets/js/106.88849931.js"><link rel="prefetch" href="/blog/assets/js/107.bf754f60.js"><link rel="prefetch" href="/blog/assets/js/108.a43622c2.js"><link rel="prefetch" href="/blog/assets/js/109.3219d87b.js"><link rel="prefetch" href="/blog/assets/js/11.f2e9eca8.js"><link rel="prefetch" href="/blog/assets/js/110.f41596b0.js"><link rel="prefetch" href="/blog/assets/js/111.da99a105.js"><link rel="prefetch" href="/blog/assets/js/112.9dd75c6f.js"><link rel="prefetch" href="/blog/assets/js/113.9322f157.js"><link rel="prefetch" href="/blog/assets/js/114.c5150cc6.js"><link rel="prefetch" href="/blog/assets/js/115.f58b49f8.js"><link rel="prefetch" href="/blog/assets/js/116.8f7d9c6f.js"><link rel="prefetch" href="/blog/assets/js/117.3c970f48.js"><link rel="prefetch" href="/blog/assets/js/118.921e1d54.js"><link rel="prefetch" href="/blog/assets/js/119.0141defb.js"><link rel="prefetch" href="/blog/assets/js/12.98512c60.js"><link rel="prefetch" href="/blog/assets/js/120.de47a761.js"><link rel="prefetch" href="/blog/assets/js/121.a0b3693a.js"><link rel="prefetch" href="/blog/assets/js/122.bbf33aff.js"><link rel="prefetch" href="/blog/assets/js/123.a358822d.js"><link rel="prefetch" href="/blog/assets/js/124.d380c979.js"><link rel="prefetch" href="/blog/assets/js/125.554c9fbf.js"><link rel="prefetch" href="/blog/assets/js/126.8c97b2f1.js"><link rel="prefetch" href="/blog/assets/js/127.805f10a4.js"><link rel="prefetch" href="/blog/assets/js/128.1df741e8.js"><link rel="prefetch" href="/blog/assets/js/129.9bd0b43e.js"><link rel="prefetch" href="/blog/assets/js/13.a79fa0c7.js"><link rel="prefetch" href="/blog/assets/js/130.8840afa7.js"><link rel="prefetch" href="/blog/assets/js/131.4ee6bdf0.js"><link rel="prefetch" href="/blog/assets/js/132.20948a31.js"><link rel="prefetch" href="/blog/assets/js/133.bb2ca85d.js"><link rel="prefetch" href="/blog/assets/js/134.f680bddd.js"><link rel="prefetch" href="/blog/assets/js/135.751d7eef.js"><link rel="prefetch" href="/blog/assets/js/136.8024998e.js"><link rel="prefetch" href="/blog/assets/js/137.57ba6d3f.js"><link rel="prefetch" href="/blog/assets/js/138.ce358840.js"><link rel="prefetch" href="/blog/assets/js/139.11250a0f.js"><link rel="prefetch" href="/blog/assets/js/14.0fdf0c78.js"><link rel="prefetch" href="/blog/assets/js/140.df0763ba.js"><link rel="prefetch" href="/blog/assets/js/141.8726d4cf.js"><link rel="prefetch" href="/blog/assets/js/142.04650ef4.js"><link rel="prefetch" href="/blog/assets/js/143.41584e7c.js"><link rel="prefetch" href="/blog/assets/js/144.fe4a1a9a.js"><link rel="prefetch" href="/blog/assets/js/145.830a0f6b.js"><link rel="prefetch" href="/blog/assets/js/146.ec81c8aa.js"><link rel="prefetch" href="/blog/assets/js/147.01fd419b.js"><link rel="prefetch" href="/blog/assets/js/148.e05cdfb5.js"><link rel="prefetch" href="/blog/assets/js/149.760a79ed.js"><link rel="prefetch" href="/blog/assets/js/15.fce722b2.js"><link rel="prefetch" href="/blog/assets/js/150.3a1675b7.js"><link rel="prefetch" href="/blog/assets/js/151.0d73a46e.js"><link rel="prefetch" href="/blog/assets/js/152.c9c054d4.js"><link rel="prefetch" href="/blog/assets/js/153.b007c8a2.js"><link rel="prefetch" href="/blog/assets/js/154.8ab912b6.js"><link rel="prefetch" href="/blog/assets/js/155.b75e437a.js"><link rel="prefetch" href="/blog/assets/js/156.2ba750fc.js"><link rel="prefetch" href="/blog/assets/js/157.50fba2ce.js"><link rel="prefetch" href="/blog/assets/js/158.e16fda40.js"><link rel="prefetch" href="/blog/assets/js/159.7fc7fd44.js"><link rel="prefetch" href="/blog/assets/js/16.7cf1b239.js"><link rel="prefetch" href="/blog/assets/js/160.dc486df0.js"><link rel="prefetch" href="/blog/assets/js/161.97acae68.js"><link rel="prefetch" href="/blog/assets/js/162.86431056.js"><link rel="prefetch" href="/blog/assets/js/163.ef0cbf93.js"><link rel="prefetch" href="/blog/assets/js/164.6939da7f.js"><link rel="prefetch" href="/blog/assets/js/165.0eb7e303.js"><link rel="prefetch" href="/blog/assets/js/166.b74fcc64.js"><link rel="prefetch" href="/blog/assets/js/167.ed3d75b7.js"><link rel="prefetch" href="/blog/assets/js/168.ffbacb83.js"><link rel="prefetch" href="/blog/assets/js/169.ec57192c.js"><link rel="prefetch" href="/blog/assets/js/17.93f492a1.js"><link rel="prefetch" href="/blog/assets/js/170.2eff8ccf.js"><link rel="prefetch" href="/blog/assets/js/171.32f86847.js"><link rel="prefetch" href="/blog/assets/js/172.44d1d022.js"><link rel="prefetch" href="/blog/assets/js/173.44325ba2.js"><link rel="prefetch" href="/blog/assets/js/174.4d70268e.js"><link rel="prefetch" href="/blog/assets/js/175.aa74a4bf.js"><link rel="prefetch" href="/blog/assets/js/176.010c2b42.js"><link rel="prefetch" href="/blog/assets/js/177.e006c7d1.js"><link rel="prefetch" href="/blog/assets/js/178.8b7976a5.js"><link rel="prefetch" href="/blog/assets/js/179.77bb52e9.js"><link rel="prefetch" href="/blog/assets/js/18.f17de23a.js"><link rel="prefetch" href="/blog/assets/js/180.459407d6.js"><link rel="prefetch" href="/blog/assets/js/181.93e8dea2.js"><link rel="prefetch" href="/blog/assets/js/182.e83e4a62.js"><link rel="prefetch" href="/blog/assets/js/183.472c384f.js"><link rel="prefetch" href="/blog/assets/js/184.a8e1b0a3.js"><link rel="prefetch" href="/blog/assets/js/185.ebeeb484.js"><link rel="prefetch" href="/blog/assets/js/186.30e344be.js"><link rel="prefetch" href="/blog/assets/js/187.7c7f8c1b.js"><link rel="prefetch" href="/blog/assets/js/188.3a8bdaf2.js"><link rel="prefetch" href="/blog/assets/js/189.8fe8cc9b.js"><link rel="prefetch" href="/blog/assets/js/19.6b963460.js"><link rel="prefetch" href="/blog/assets/js/190.120bd8c0.js"><link rel="prefetch" href="/blog/assets/js/191.4c3c270b.js"><link rel="prefetch" href="/blog/assets/js/192.bcd4e550.js"><link rel="prefetch" href="/blog/assets/js/193.0fe0d5e0.js"><link rel="prefetch" href="/blog/assets/js/194.4513955e.js"><link rel="prefetch" href="/blog/assets/js/195.92b8c6d0.js"><link rel="prefetch" href="/blog/assets/js/196.08715780.js"><link rel="prefetch" href="/blog/assets/js/197.c69fa6d4.js"><link rel="prefetch" href="/blog/assets/js/198.872388aa.js"><link rel="prefetch" href="/blog/assets/js/199.bb8f5e4f.js"><link rel="prefetch" href="/blog/assets/js/20.839dae41.js"><link rel="prefetch" href="/blog/assets/js/200.1fed86d2.js"><link rel="prefetch" href="/blog/assets/js/201.5ba078d9.js"><link rel="prefetch" href="/blog/assets/js/202.b49b23f4.js"><link rel="prefetch" href="/blog/assets/js/203.d88a03d9.js"><link rel="prefetch" href="/blog/assets/js/204.fb928277.js"><link rel="prefetch" href="/blog/assets/js/205.432c3d8d.js"><link rel="prefetch" href="/blog/assets/js/206.4374de87.js"><link rel="prefetch" href="/blog/assets/js/207.02a926dc.js"><link rel="prefetch" href="/blog/assets/js/208.40276146.js"><link rel="prefetch" href="/blog/assets/js/209.09ea3d1f.js"><link rel="prefetch" href="/blog/assets/js/21.bd21bd29.js"><link rel="prefetch" href="/blog/assets/js/210.65b5c252.js"><link rel="prefetch" href="/blog/assets/js/211.de944cbe.js"><link rel="prefetch" href="/blog/assets/js/212.8a476248.js"><link rel="prefetch" href="/blog/assets/js/213.503671a6.js"><link rel="prefetch" href="/blog/assets/js/214.2be447ed.js"><link rel="prefetch" href="/blog/assets/js/215.94598eb8.js"><link rel="prefetch" href="/blog/assets/js/216.a72becb1.js"><link rel="prefetch" href="/blog/assets/js/217.a3b7d409.js"><link rel="prefetch" href="/blog/assets/js/218.a6b835cb.js"><link rel="prefetch" href="/blog/assets/js/219.b99343b6.js"><link rel="prefetch" href="/blog/assets/js/22.e6bcf65d.js"><link rel="prefetch" href="/blog/assets/js/220.8065033b.js"><link rel="prefetch" href="/blog/assets/js/221.f9eb596c.js"><link rel="prefetch" href="/blog/assets/js/222.1fb8fe25.js"><link rel="prefetch" href="/blog/assets/js/223.d5ff1bff.js"><link rel="prefetch" href="/blog/assets/js/224.364b4b11.js"><link rel="prefetch" href="/blog/assets/js/225.bd8b00c7.js"><link rel="prefetch" href="/blog/assets/js/226.78192713.js"><link rel="prefetch" href="/blog/assets/js/227.06ec006e.js"><link rel="prefetch" href="/blog/assets/js/228.166546a8.js"><link rel="prefetch" href="/blog/assets/js/229.51820867.js"><link rel="prefetch" href="/blog/assets/js/23.7bb82fc7.js"><link rel="prefetch" href="/blog/assets/js/230.3f45e487.js"><link rel="prefetch" href="/blog/assets/js/231.c6faedb6.js"><link rel="prefetch" href="/blog/assets/js/232.f938a3a8.js"><link rel="prefetch" href="/blog/assets/js/233.0dc59324.js"><link rel="prefetch" href="/blog/assets/js/234.bb73adca.js"><link rel="prefetch" href="/blog/assets/js/235.97ed69db.js"><link rel="prefetch" href="/blog/assets/js/236.a8c51930.js"><link rel="prefetch" href="/blog/assets/js/237.6ae31c88.js"><link rel="prefetch" href="/blog/assets/js/238.2f5c56ae.js"><link rel="prefetch" href="/blog/assets/js/239.506a4e9f.js"><link rel="prefetch" href="/blog/assets/js/24.2c9c4ee6.js"><link rel="prefetch" href="/blog/assets/js/25.b4de33d1.js"><link rel="prefetch" href="/blog/assets/js/26.0bb98ba9.js"><link rel="prefetch" href="/blog/assets/js/27.df98327e.js"><link rel="prefetch" href="/blog/assets/js/28.31289bac.js"><link rel="prefetch" href="/blog/assets/js/29.45af5621.js"><link rel="prefetch" href="/blog/assets/js/30.d5c08e66.js"><link rel="prefetch" href="/blog/assets/js/31.78e43a68.js"><link rel="prefetch" href="/blog/assets/js/32.53ca76ee.js"><link rel="prefetch" href="/blog/assets/js/33.081e8ef6.js"><link rel="prefetch" href="/blog/assets/js/34.a320a186.js"><link rel="prefetch" href="/blog/assets/js/35.f3214c18.js"><link rel="prefetch" href="/blog/assets/js/36.fb4476c3.js"><link rel="prefetch" href="/blog/assets/js/37.09dfc1c5.js"><link rel="prefetch" href="/blog/assets/js/38.6624bf02.js"><link rel="prefetch" href="/blog/assets/js/39.99449e5d.js"><link rel="prefetch" href="/blog/assets/js/4.44654b1a.js"><link rel="prefetch" href="/blog/assets/js/40.80101c19.js"><link rel="prefetch" href="/blog/assets/js/41.0f72d2c3.js"><link rel="prefetch" href="/blog/assets/js/42.c6ded3fe.js"><link rel="prefetch" href="/blog/assets/js/43.6d9424d6.js"><link rel="prefetch" href="/blog/assets/js/44.835e4b5c.js"><link rel="prefetch" href="/blog/assets/js/45.d74d29a2.js"><link rel="prefetch" href="/blog/assets/js/46.d15a7dc0.js"><link rel="prefetch" href="/blog/assets/js/47.8d66ca97.js"><link rel="prefetch" href="/blog/assets/js/48.3c1102e1.js"><link rel="prefetch" href="/blog/assets/js/49.e17a3436.js"><link rel="prefetch" href="/blog/assets/js/5.88de390f.js"><link rel="prefetch" href="/blog/assets/js/50.6750f186.js"><link rel="prefetch" href="/blog/assets/js/51.9f93af9f.js"><link rel="prefetch" href="/blog/assets/js/52.f3ef3b5e.js"><link rel="prefetch" href="/blog/assets/js/53.a6bacd25.js"><link rel="prefetch" href="/blog/assets/js/55.2562d0c8.js"><link rel="prefetch" href="/blog/assets/js/56.14ea4931.js"><link rel="prefetch" href="/blog/assets/js/57.a2fad780.js"><link rel="prefetch" href="/blog/assets/js/58.8165b971.js"><link rel="prefetch" href="/blog/assets/js/59.556cab0d.js"><link rel="prefetch" href="/blog/assets/js/6.277038ca.js"><link rel="prefetch" href="/blog/assets/js/60.f048aa7c.js"><link rel="prefetch" href="/blog/assets/js/61.bdb307a8.js"><link rel="prefetch" href="/blog/assets/js/62.37a94f10.js"><link rel="prefetch" href="/blog/assets/js/63.74811780.js"><link rel="prefetch" href="/blog/assets/js/64.d3429318.js"><link rel="prefetch" href="/blog/assets/js/65.acfdd371.js"><link rel="prefetch" href="/blog/assets/js/66.cb805d9b.js"><link rel="prefetch" href="/blog/assets/js/67.39f85baa.js"><link rel="prefetch" href="/blog/assets/js/68.7f79766a.js"><link rel="prefetch" href="/blog/assets/js/69.fa8624bd.js"><link rel="prefetch" href="/blog/assets/js/7.474f8f8d.js"><link rel="prefetch" href="/blog/assets/js/70.1f3e978d.js"><link rel="prefetch" href="/blog/assets/js/71.13cd9358.js"><link rel="prefetch" href="/blog/assets/js/72.739b22a8.js"><link rel="prefetch" href="/blog/assets/js/73.95f69ae2.js"><link rel="prefetch" href="/blog/assets/js/74.b6624f6a.js"><link rel="prefetch" href="/blog/assets/js/75.b0d9aa06.js"><link rel="prefetch" href="/blog/assets/js/76.681b78df.js"><link rel="prefetch" href="/blog/assets/js/77.46f6e413.js"><link rel="prefetch" href="/blog/assets/js/78.aebd00ee.js"><link rel="prefetch" href="/blog/assets/js/79.1b784d15.js"><link rel="prefetch" href="/blog/assets/js/8.9428e7ee.js"><link rel="prefetch" href="/blog/assets/js/80.1f550d53.js"><link rel="prefetch" href="/blog/assets/js/81.101cc131.js"><link rel="prefetch" href="/blog/assets/js/82.84fd301c.js"><link rel="prefetch" href="/blog/assets/js/83.b3a8dfaf.js"><link rel="prefetch" href="/blog/assets/js/84.38102a34.js"><link rel="prefetch" href="/blog/assets/js/85.24532d6a.js"><link rel="prefetch" href="/blog/assets/js/86.1dabbf00.js"><link rel="prefetch" href="/blog/assets/js/87.763da0f2.js"><link rel="prefetch" href="/blog/assets/js/88.ff6e5f7c.js"><link rel="prefetch" href="/blog/assets/js/89.187e5e16.js"><link rel="prefetch" href="/blog/assets/js/9.da143545.js"><link rel="prefetch" href="/blog/assets/js/90.3c8cff94.js"><link rel="prefetch" href="/blog/assets/js/91.a50bd44d.js"><link rel="prefetch" href="/blog/assets/js/92.5484868f.js"><link rel="prefetch" href="/blog/assets/js/93.d6f43dbe.js"><link rel="prefetch" href="/blog/assets/js/94.822dd217.js"><link rel="prefetch" href="/blog/assets/js/95.cddef6ae.js"><link rel="prefetch" href="/blog/assets/js/96.80e5a938.js"><link rel="prefetch" href="/blog/assets/js/97.1f5e5197.js"><link rel="prefetch" href="/blog/assets/js/98.e3a275c8.js"><link rel="prefetch" href="/blog/assets/js/99.74ef9616.js">
  13. <link rel="stylesheet" href="/blog/assets/css/0.styles.dc03b589.css">
  14. </head>
  15. <body class="theme-mode-light">
  16. <div id="app" data-server-rendered="true"><div class="theme-container sidebar-open have-rightmenu"><header class="navbar blur"><div title="目录" class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/blog/" class="home-link router-link-active"><img src="/blog/img/logo.png" alt="彪哥博客" class="logo"> <span class="site-name can-hide">彪哥博客</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/blog/" class="nav-link">首页</a></div><div class="nav-item"><a href="http://fseller.com" target="_blank" rel="noopener noreferrer" class="nav-link external">
  17. 个人游戏网站
  18. <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="前端" class="dropdown-title"><a href="/blog/web/" class="link-title">前端</a> <span class="title" style="display:none;">前端</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><h4>前端文章</h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/blog/pages/8143cc480faf9a11/" class="nav-link">JavaScript</a></li></ul></li><li class="dropdown-item"><h4>学习笔记</h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/blog/note/javascript/" class="nav-link">《JavaScript教程》</a></li><li class="dropdown-subitem"><a href="/blog/note/js/" class="nav-link">《JavaScript高级程序设计》</a></li><li class="dropdown-subitem"><a href="/blog/note/es6/" class="nav-link">《ES6 教程》</a></li><li class="dropdown-subitem"><a href="/blog/note/vue/" class="nav-link">《Vue》</a></li><li class="dropdown-subitem"><a href="/blog/note/react/" class="nav-link">《React》</a></li><li class="dropdown-subitem"><a href="/blog/note/typescript-axios/" class="nav-link">《TypeScript 从零实现 axios》</a></li><li class="dropdown-subitem"><a href="/blog/note/git/" class="nav-link">《Git》</a></li><li class="dropdown-subitem"><a href="/blog/pages/51afd6/" class="nav-link">TypeScript</a></li><li class="dropdown-subitem"><a href="/blog/pages/4643cd/" class="nav-link">JS设计模式总结</a></li></ul></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="页面" class="dropdown-title"><a href="/blog/ui/" class="link-title">页面</a> <span class="title" style="display:none;">页面</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/blog/pages/8309a5b876fc95e3/" class="nav-link">HTML</a></li><li class="dropdown-item"><!----> <a href="/blog/pages/0a83b083bdf257cb/" class="nav-link">CSS</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="技术" class="dropdown-title"><a href="/blog/technology/" class="link-title">技术</a> <span class="title" style="display:none;">技术</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/blog/pages/9a7ee40fc232253e/" class="nav-link">技术文档</a></li><li class="dropdown-item"><!----> <a href="/blog/pages/4c778760be26d8b3/" class="nav-link">GitHub技巧</a></li><li class="dropdown-item"><!----> <a href="/blog/pages/117708e0af7f0bd9/" class="nav-link">Nodejs</a></li><li class="dropdown-item"><!----> <a href="/blog/pages/41f87d890d0a02af/" class="nav-link">博客搭建</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="更多" class="dropdown-title"><a href="/blog/more/" class="link-title">更多</a> <span class="title" style="display:none;">更多</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/blog/pages/f2a556/" class="nav-link">学习</a></li><li class="dropdown-item"><!----> <a href="/blog/pages/aea6571b7a8bae86/" class="nav-link">面试</a></li><li class="dropdown-item"><!----> <a href="/blog/pages/2d615df9a36a98ed/" class="nav-link">心情杂货</a></li><li class="dropdown-item"><!----> <a href="/blog/pages/baaa02/" class="nav-link">实用技巧</a></li><li class="dropdown-item"><!----> <a href="/blog/friends/" class="nav-link">友情链接</a></li></ul></div></div><div class="nav-item"><a href="/blog/about/" class="nav-link">关于</a></div><div class="nav-item"><a href="/blog/pages/beb6c0bd8a66cea6/" class="nav-link">收藏</a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="索引" class="dropdown-title"><a href="/blog/archives/" class="link-title">索引</a> <span class="title" style="display:none;">索引</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/blog/categories/" class="nav-link">分类</a></li><li class="dropdown-item"><!----> <a href="/blog/tags/" class="nav-link">标签</a></li><li class="dropdown-item"><!----> <a href="/blog/archives/" class="nav-link">归档</a></li></ul></div></div> <a href="https://github.com/heBody/blog" target="_blank" rel="noopener noreferrer" class="repo-link">
  19. GitHub
  20. <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></nav></div></header> <div class="sidebar-mask"></div> <div class="sidebar-hover-trigger"></div> <aside class="sidebar" style="display:none;"><div class="blogger"><img src="/blog/img/head.jpg"> <div class="blogger-info"><h3>彪哥</h3> <span>爱好前端</span></div></div> <nav class="nav-links"><div class="nav-item"><a href="/blog/" class="nav-link">首页</a></div><div class="nav-item"><a href="http://fseller.com" target="_blank" rel="noopener noreferrer" class="nav-link external">
  21. 个人游戏网站
  22. <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="前端" class="dropdown-title"><a href="/blog/web/" class="link-title">前端</a> <span class="title" style="display:none;">前端</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><h4>前端文章</h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/blog/pages/8143cc480faf9a11/" class="nav-link">JavaScript</a></li></ul></li><li class="dropdown-item"><h4>学习笔记</h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/blog/note/javascript/" class="nav-link">《JavaScript教程》</a></li><li class="dropdown-subitem"><a href="/blog/note/js/" class="nav-link">《JavaScript高级程序设计》</a></li><li class="dropdown-subitem"><a href="/blog/note/es6/" class="nav-link">《ES6 教程》</a></li><li class="dropdown-subitem"><a href="/blog/note/vue/" class="nav-link">《Vue》</a></li><li class="dropdown-subitem"><a href="/blog/note/react/" class="nav-link">《React》</a></li><li class="dropdown-subitem"><a href="/blog/note/typescript-axios/" class="nav-link">《TypeScript 从零实现 axios》</a></li><li class="dropdown-subitem"><a href="/blog/note/git/" class="nav-link">《Git》</a></li><li class="dropdown-subitem"><a href="/blog/pages/51afd6/" class="nav-link">TypeScript</a></li><li class="dropdown-subitem"><a href="/blog/pages/4643cd/" class="nav-link">JS设计模式总结</a></li></ul></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="页面" class="dropdown-title"><a href="/blog/ui/" class="link-title">页面</a> <span class="title" style="display:none;">页面</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/blog/pages/8309a5b876fc95e3/" class="nav-link">HTML</a></li><li class="dropdown-item"><!----> <a href="/blog/pages/0a83b083bdf257cb/" class="nav-link">CSS</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="技术" class="dropdown-title"><a href="/blog/technology/" class="link-title">技术</a> <span class="title" style="display:none;">技术</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/blog/pages/9a7ee40fc232253e/" class="nav-link">技术文档</a></li><li class="dropdown-item"><!----> <a href="/blog/pages/4c778760be26d8b3/" class="nav-link">GitHub技巧</a></li><li class="dropdown-item"><!----> <a href="/blog/pages/117708e0af7f0bd9/" class="nav-link">Nodejs</a></li><li class="dropdown-item"><!----> <a href="/blog/pages/41f87d890d0a02af/" class="nav-link">博客搭建</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="更多" class="dropdown-title"><a href="/blog/more/" class="link-title">更多</a> <span class="title" style="display:none;">更多</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/blog/pages/f2a556/" class="nav-link">学习</a></li><li class="dropdown-item"><!----> <a href="/blog/pages/aea6571b7a8bae86/" class="nav-link">面试</a></li><li class="dropdown-item"><!----> <a href="/blog/pages/2d615df9a36a98ed/" class="nav-link">心情杂货</a></li><li class="dropdown-item"><!----> <a href="/blog/pages/baaa02/" class="nav-link">实用技巧</a></li><li class="dropdown-item"><!----> <a href="/blog/friends/" class="nav-link">友情链接</a></li></ul></div></div><div class="nav-item"><a href="/blog/about/" class="nav-link">关于</a></div><div class="nav-item"><a href="/blog/pages/beb6c0bd8a66cea6/" class="nav-link">收藏</a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="索引" class="dropdown-title"><a href="/blog/archives/" class="link-title">索引</a> <span class="title" style="display:none;">索引</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/blog/categories/" class="nav-link">分类</a></li><li class="dropdown-item"><!----> <a href="/blog/tags/" class="nav-link">标签</a></li><li class="dropdown-item"><!----> <a href="/blog/archives/" class="nav-link">归档</a></li></ul></div></div> <a href="https://github.com/heBody/blog" target="_blank" rel="noopener noreferrer" class="repo-link">
  23. GitHub
  24. <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></nav> <ul class="sidebar-links"><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading open"><span>技术文档</span> <span class="arrow down"></span></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/blog/pages/9a7ee40fc232253e/" class="sidebar-link">Git使用手册</a></li><li><a href="/blog/pages/ad247c4332211551/" class="sidebar-link">Markdown使用教程</a></li><li><a href="/blog/pages/61f2f95fd7da14fd/" class="sidebar-link">npm常用命令</a></li><li><a href="/blog/pages/dec4f3f00e71a312/" aria-current="page" class="active sidebar-link">npm packageJson属性详解</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header level2"><a href="/blog/pages/dec4f3f00e71a312/#概述" class="sidebar-link">概述</a></li><li class="sidebar-sub-header level2"><a href="/blog/pages/dec4f3f00e71a312/#name" class="sidebar-link">name</a></li><li class="sidebar-sub-header level2"><a href="/blog/pages/dec4f3f00e71a312/#version" class="sidebar-link">version</a></li><li class="sidebar-sub-header level2"><a href="/blog/pages/dec4f3f00e71a312/#description" class="sidebar-link">description</a></li><li class="sidebar-sub-header level2"><a href="/blog/pages/dec4f3f00e71a312/#keywords" class="sidebar-link">keywords</a></li><li class="sidebar-sub-header level2"><a href="/blog/pages/dec4f3f00e71a312/#homepage" class="sidebar-link">homepage</a></li><li class="sidebar-sub-header level2"><a href="/blog/pages/dec4f3f00e71a312/#bugs" class="sidebar-link">bugs</a></li><li class="sidebar-sub-header level2"><a href="/blog/pages/dec4f3f00e71a312/#license" class="sidebar-link">license</a></li><li class="sidebar-sub-header level2"><a href="/blog/pages/dec4f3f00e71a312/#和用户相关的属性-author-contributors" class="sidebar-link">和用户相关的属性: author, contributors</a></li><li class="sidebar-sub-header level2"><a href="/blog/pages/dec4f3f00e71a312/#files" class="sidebar-link">files</a></li><li class="sidebar-sub-header level2"><a href="/blog/pages/dec4f3f00e71a312/#main" class="sidebar-link">main</a></li><li class="sidebar-sub-header level2"><a href="/blog/pages/dec4f3f00e71a312/#bin" class="sidebar-link">bin</a></li><li class="sidebar-sub-header level2"><a href="/blog/pages/dec4f3f00e71a312/#man" class="sidebar-link">man</a></li><li class="sidebar-sub-header level2"><a href="/blog/pages/dec4f3f00e71a312/#directories" class="sidebar-link">directories</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header level3"><a href="/blog/pages/dec4f3f00e71a312/#directories-lib" class="sidebar-link">directories.lib</a></li><li class="sidebar-sub-header level3"><a href="/blog/pages/dec4f3f00e71a312/#directories-bin" class="sidebar-link">directories.bin</a></li><li class="sidebar-sub-header level3"><a href="/blog/pages/dec4f3f00e71a312/#directories-man" class="sidebar-link">directories.man</a></li><li class="sidebar-sub-header level3"><a href="/blog/pages/dec4f3f00e71a312/#directories-doc" class="sidebar-link">directories.doc</a></li><li class="sidebar-sub-header level3"><a href="/blog/pages/dec4f3f00e71a312/#directories-example" class="sidebar-link">directories.example</a></li></ul></li><li class="sidebar-sub-header level2"><a href="/blog/pages/dec4f3f00e71a312/#repository" class="sidebar-link">repository</a></li><li class="sidebar-sub-header level2"><a href="/blog/pages/dec4f3f00e71a312/#scripts" class="sidebar-link">scripts</a></li><li class="sidebar-sub-header level2"><a href="/blog/pages/dec4f3f00e71a312/#config" class="sidebar-link">config</a></li><li class="sidebar-sub-header level2"><a href="/blog/pages/dec4f3f00e71a312/#dependencies" class="sidebar-link">dependencies</a></li><li class="sidebar-sub-header level2"><a href="/blog/pages/dec4f3f00e71a312/#urls-as-dependencies" class="sidebar-link">URLs as Dependencies</a></li><li class="sidebar-sub-header level2"><a href="/blog/pages/dec4f3f00e71a312/#git-urls-as-dependencies" class="sidebar-link">Git URLs as Dependencies</a></li><li class="sidebar-sub-header level2"><a href="/blog/pages/dec4f3f00e71a312/#github-urls" class="sidebar-link">GitHub URLs</a></li><li class="sidebar-sub-header level2"><a href="/blog/pages/dec4f3f00e71a312/#local-paths" class="sidebar-link">Local Paths</a></li><li class="sidebar-sub-header level2"><a href="/blog/pages/dec4f3f00e71a312/#devdependencies" class="sidebar-link">devDependencies</a></li><li class="sidebar-sub-header level2"><a href="/blog/pages/dec4f3f00e71a312/#peerdependencies" class="sidebar-link">peerDependencies</a></li><li class="sidebar-sub-header level2"><a href="/blog/pages/dec4f3f00e71a312/#bundleddependencies" class="sidebar-link">bundledDependencies</a></li><li class="sidebar-sub-header level2"><a href="/blog/pages/dec4f3f00e71a312/#optionaldependencies" class="sidebar-link">optionalDependencies</a></li><li class="sidebar-sub-header level2"><a href="/blog/pages/dec4f3f00e71a312/#engines" class="sidebar-link">engines</a></li><li class="sidebar-sub-header level2"><a href="/blog/pages/dec4f3f00e71a312/#enginestrict" class="sidebar-link">engineStrict</a></li><li class="sidebar-sub-header level2"><a href="/blog/pages/dec4f3f00e71a312/#os" class="sidebar-link">os</a></li><li class="sidebar-sub-header level2"><a href="/blog/pages/dec4f3f00e71a312/#cpu" class="sidebar-link">cpu</a></li><li class="sidebar-sub-header level2"><a href="/blog/pages/dec4f3f00e71a312/#preferglobal" class="sidebar-link">preferGlobal</a></li><li class="sidebar-sub-header level2"><a href="/blog/pages/dec4f3f00e71a312/#private" class="sidebar-link">private</a></li><li class="sidebar-sub-header level2"><a href="/blog/pages/dec4f3f00e71a312/#publishconfig" class="sidebar-link">publishConfig</a></li><li class="sidebar-sub-header level2"><a href="/blog/pages/dec4f3f00e71a312/#default-values" class="sidebar-link">DEFAULT VALUES</a></li><li class="sidebar-sub-header level2"><a href="/blog/pages/dec4f3f00e71a312/#参考文档列表-https-docs-npmjs-com" class="sidebar-link">参考文档列表(https://docs.npmjs.com/)</a></li></ul></li><li><a href="/blog/pages/4e8444e2d534d14f/" class="sidebar-link">yaml语言教程</a></li><li><a href="/blog/pages/922650/" class="sidebar-link">Git修改分支名</a></li></ul></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>GitHub技巧</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>Nodejs</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>博客搭建</span> <span class="arrow right"></span></p> <!----></section></li></ul> </aside> <div><main class="page"><div class="theme-vdoing-wrapper "><div class="articleInfo-wrap" data-v-06970110><div class="articleInfo" data-v-06970110><ul class="breadcrumbs" data-v-06970110><li data-v-06970110><a href="/blog/" title="首页" class="iconfont icon-home router-link-active" data-v-06970110></a></li> <li data-v-06970110><a href="/blog/technology/#技术" data-v-06970110>技术</a></li><li data-v-06970110><a href="/blog/technology/#技术文档" data-v-06970110>技术文档</a></li></ul> <div class="info" data-v-06970110><div title="作者" class="author iconfont icon-touxiang" data-v-06970110><a href="https://github.com/heBody" target="_blank" title="作者" class="beLink" data-v-06970110>heBody</a></div> <div title="创建时间" class="date iconfont icon-riqi" data-v-06970110><a href="javascript:;" data-v-06970110>2020-04-08</a></div> <!----></div></div></div> <!----> <div class="content-wrapper"><div class="right-menu-wrapper"><div class="right-menu-margin"><div class="right-menu-title">目录</div> <div class="right-menu-content"></div></div></div> <h1><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAAAXNSR0IArs4c6QAABH1JREFUSA3tVl1oHFUUPmdmd2ltklqbpJDiNnXFmgbFktho7YMPNiJSSZM0+CAYSkUELVhM6YuwIPpgoOKDqOBDC0XE2CQoNtQXBUFTTcCi+Wlh1V2TQExsUzcltd3M9Tt3ZjZzZ2fT+OJTL8yeM+eee757fmeJbq//KQL8X3DUSFOcfr7cRsRtxNQMWueeVzOkaITIGqQHNg5y8+jNW9ldM7A6nTpAjuolUikAwq7CE3WcM2RRDz+XGVgN3FptU/aUSlvq9Pa3iZ1+sgAqJyyAFqkipd9dqiwHF3P65YycLWc/6sqGrvoEoIp6DOFaX5h6+dnfjkWprwqsPk0dUGq5vySwDImC10KxFHgGL1SWoc92O3eVht09qdXNH11I2SsTsJYqMWzihqGMi+A+Garf3BAuuLI5oGlULyNfyB/HYNujwktOfRrMr5t77NmevqaUopx0grnKAyvVpmwUDB4x6FPXuGvYLTDwWsejwgtgkYKPqRJg8SV6xaiZ3ZTppGneS4yfH5/66fZSDHv+QZci/+h5c5UHtpy67JUqGppM0sh0Nc1dW6/N1W5Yoqat8/TU/VnadmdeW2PLLSyh0cvxBs3KbqTmwYPpxN4do/mzE8nEpvX/UMu2Wbp74zUAK5q6WkHns7V0eWkdPbPzd3rxkTGybadYySumVzhcaJFbs5UrEkQ/+CK8gF5dnh/6ciIZ73gwQ927L1IitoxKLXYP3SjYdOrHHfTZhRRlFyrorafPk20B3HPD1y2G3qKZME5Jcf3t/HUC13/8tSd++vqFveMUTwAUxSUFI1QekR1+bIze3D9MF2aq6cPvG72CgnldWCFqyRw3lwH8ZMerjTD9ElRO7Gv44wNpC90aASqGfVlz/Rx17srQ57/UU26hkhQqUB7dBR71WmzQhHUnblGmVOEw0jhbV1n9OlXUDCIRGaNV5Jp43N516fN7JmnTHdfp7Hgy0luO4aMhtkLL8Bi3bUWYvzh5Mn1dTxrL6QmGuRhGL/TiTTxRoEdTszSaq9GR0NGA3KdkOz3hqSV3MIDhQ5IVX/Ivx3umBti2es2h4eZby7x8br1rkf7Mo90AqC8aQ3sJeNzqFRu+vSANAQe3PL7l0HGOAdwDCeZYvNKeoZp1Qfs6Aipndh86HmFRi0LAnEO47wsqM6cdfjh3jBPUzhZy7nvlUfFsamED1VQt6aISHVymXZ/B2aCtIG8AI8xfobj2d3en1wWVhOeHELKmLQ1s211s88comkv4UCwWyF787mJdYXtNfhKAXVqnKTq8QZvGAGGOfaTo5pGZ/PwbUCr5+DPr/1J92JNHr9aOl/F3iI5+O1nfybsGxoimvZ3ViWSluDITw3P37mypheDIPY0tw7+O/5ApbkYw+zpfaUVu32Pi98+defdUhEpZkRFq0aqyNh9FuL9hpYbEm6iwi0z2REd09ZmyENEbuhjDWzKvZXTqKYaBIr3tt5kuPtQBZFvEUwHt60vfCNu41XsksH9Ij1BMMz1Y0OOunHNShFIP5868g5zeXmuLwL9T4b6Q2+KejgAAAABJRU5ErkJggg==">npm packageJson属性详解<!----></h1> <div class="theme-vdoing-content content__default"><h1 id="npm-package-json属性详解"><a href="#npm-package-json属性详解" class="header-anchor">#</a> npm package.json属性详解</h1> <blockquote><p>本文转自<a href="https://www.cnblogs.com/tzyy/p/5193811.html" target="_blank" rel="noopener noreferrer">https://www.cnblogs.com/tzyy/p/5193811.html<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a>,作者:TZYY</p></blockquote> <h2 id="概述"><a href="#概述" class="header-anchor">#</a> 概述</h2> <p><code>package.json</code>必须是一个严格的json文件,而不仅仅是js里边的一个对象。其中很多属性可以通过<code>npm-config</code>来生成</p> <h2 id="name"><a href="#name" class="header-anchor">#</a> name</h2> <p><code>package.json</code>中最重要的属性是<code>name</code>和<code>version</code>两个属性,这两个属性是必须要有的,否则模块就无法被安装,这两个属性一起形成了一个npm模块的唯一标识符。模块中内容变更的同时,模块版本也应该一起变化。
  25. <code>name</code>属性就是你的模块名称,下面是一些命名规则:</p> <ul><li><p><code>name</code>必须小于等于214个字节,包括前缀名称在内(如 xxx/xxxmodule)。</p></li> <li><p><code>name</code>不能以&quot;_&quot;或&quot;.&quot;开头</p></li> <li><p>不能含有大写字母</p></li> <li><p><code>name</code>会成为url的一部分,不能含有url非法字符</p> <p>下面是官网文档的一些建议:</p></li> <li><p>不要使用和node核心模块一样的名称</p></li> <li><p><code>name</code>中不要含有&quot;js&quot;和&quot;node&quot;。 It's assumed that it's js, since you're writing a package.json file, and you can specify the engine using the &quot;engines&quot; field. (See below.)</p></li> <li><p><code>name</code>属性会成为模块url、命令行中的一个参数或者一个文件夹名称,任何非url安全的字符在name中都不能使用,也不能以&quot;_&quot;或&quot;.&quot;开头</p></li> <li><p><code>name</code>属性也许会被写在<code>require()</code>的参数中,所以最好取个简短而语义化的值。</p></li> <li><p>创建一个模块前可以先到后边的网址查查<code>name</code>是否已经被占用. <a href="https://www.npmjs.com/" target="_blank" rel="noopener noreferrer">https://www.npmjs.com/<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <ul><li><div class="language-sh line-numbers-mode"><pre class="language-sh"><code><span class="token comment"># 发布一个包的时候,需要检验某个包名是否存在</span>
  26. <span class="token function">npm</span> search <span class="token operator">&lt;</span>ModuleName<span class="token operator">&gt;</span>
  27. </code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br></div></div></li></ul></li></ul> <p><code>name</code>属性可以有一些前缀如 e.g. @myorg/mypackage.在npm-scope(7)的文档中可以看到详细说明</p> <h2 id="version"><a href="#version" class="header-anchor">#</a> version</h2> <p><code>version</code>必须可以被npm依赖的一个<code>node-semver</code>模块解析。具体规则见下面的<code>dependencies</code>模块</p> <h2 id="description"><a href="#description" class="header-anchor">#</a> description</h2> <p>一个描述,方便别人了解你的模块作用,搜索的时候也有用。</p> <h2 id="keywords"><a href="#keywords" class="header-anchor">#</a> keywords</h2> <p>一个字符串数组,方便别人搜索到本模块</p> <h2 id="homepage"><a href="#homepage" class="header-anchor">#</a> homepage</h2> <p>项目主页url
  28. <strong>注意:</strong> 这个项目主页url和url属性不同,如果你填写了url属性,npm注册工具会认为你把项目发布到其他地方了,获取模块的时候不会从npm官方仓库获取,而是会重定向到url属性配置的地址。
  29. (原文档中用了 spit(吐)这个单词,作者表示他不是在开玩笑:)</p> <h2 id="bugs"><a href="#bugs" class="header-anchor">#</a> bugs</h2> <p>填写一个bug提交地址或者一个邮箱,被你的模块坑到的人可以通过这里吐槽,例如:</p> <div class="language-json line-numbers-mode"><pre class="language-json"><code><span class="token punctuation">{</span>
  30. <span class="token property">&quot;url&quot;</span> <span class="token operator">:</span> <span class="token string">&quot;https://github.com/owner/project/issues&quot;</span><span class="token punctuation">,</span>
  31. <span class="token property">&quot;email&quot;</span> <span class="token operator">:</span> <span class="token string">&quot;project@hostname.com&quot;</span>
  32. <span class="token punctuation">}</span>
  33. </code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br></div></div><p>url和email可以任意填或不填,如果只填一个,可以直接写成一个字符串而不是对象。如果填写了url,npm bugs命令会使用这个url。</p> <h2 id="license"><a href="#license" class="header-anchor">#</a> license</h2> <p>你应该为你的模块制定一个协议,让用户知道他们有何权限来使用你的模块,以及使用该模块有哪些限制。最简单的,例如你用BSD-3-Clause 或 MIT之类的协议,如下:</p> <div class="language-json line-numbers-mode"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">&quot;license&quot;</span> <span class="token operator">:</span> <span class="token string">&quot;MIT&quot;</span> <span class="token punctuation">}</span>
  34. </code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>你可以在<a href="https://spdx.org/licenses/" target="_blank" rel="noopener noreferrer">https://spdx.org/licenses/ <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a>这个地址查阅协议列表 。</p> <h2 id="和用户相关的属性-author-contributors"><a href="#和用户相关的属性-author-contributors" class="header-anchor">#</a> 和用户相关的属性: author, contributors</h2> <p><code>author</code>是一个码农, <code>contributors</code>是一个码农数组。 <code>person</code>是一个有一些描述属性的对象,如下 like this:</p> <div class="language-json line-numbers-mode"><pre class="language-json"><code><span class="token punctuation">{</span>
  35. <span class="token property">&quot;name&quot;</span> <span class="token operator">:</span> <span class="token string">&quot;Barney Rubble&quot;</span><span class="token punctuation">,</span>
  36. <span class="token property">&quot;email&quot;</span> <span class="token operator">:</span> <span class="token string">&quot;b@rubble.com&quot;</span><span class="token punctuation">,</span>
  37. <span class="token property">&quot;url&quot;</span> <span class="token operator">:</span> <span class="token string">&quot;http://barnyrubble.tumblr.com/&quot;</span>
  38. <span class="token punctuation">}</span>
  39. </code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br></div></div><p>也可以按如下格式缩写,npm会帮着转换:</p> <div class="language- line-numbers-mode"><pre class="language-text"><code>&quot;Barney Rubble b@rubble.com (http://barnyrubble.tumblr.com/)&quot;
  40. </code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p><code>email</code>和<code>url</code>属性实际上都是可以省略的。描述用户信息的还有一个<code>maintainers</code>(维护者)属性。</p> <h2 id="files"><a href="#files" class="header-anchor">#</a> files</h2> <p><code>files</code>属性的值是一个数组,内容是模块下文件名或者文件夹名,如果是文件夹名,则文件夹下所有的文件也会被包含进来(除非文件被另一些配置排除了)
  41. 你也可以在模块根目录下创建一个<code>.npmignore</code>文件(windows下无法直接创建以&quot;.&quot;开头的文件,使用linux命令行工具创建如git bash),写在这个文件里边的文件即便被写在files属性里边也会被排除在外,这个文件的写法&quot;.gitignore&quot;类似。</p> <h2 id="main"><a href="#main" class="header-anchor">#</a> main</h2> <p><code>main</code>属性指定了程序的主入口文件。意思是,如果你的模块被命名为foo,用户安装了这个模块并通过require(&quot;foo&quot;)来使用这个模块,那么require返回的内容就是main属性指定的文件中 module.exports指向的对象。
  42. 它应该指向模块根目录下的一个文件。对大对数模块而言,这个属性更多的是让模块有一个主入口文件,然而很多模块并不写这个属性。</p> <h2 id="bin"><a href="#bin" class="header-anchor">#</a> bin</h2> <p>很多模块有一个或多个需要配置到PATH路径下的可执行模块,npm让这个工作变得十分简单(实际上npm本身也是通过bin属性安装为一个可执行命令的)
  43. 如果要用npm的这个功能,在package.json里边配置一个bin属性。bin属性是一个已命令名称为key,本地文件名称为value的map如下:</p> <div class="language-json line-numbers-mode"><pre class="language-json"><code><span class="token punctuation">{</span>
  44. <span class="token property">&quot;bin&quot;</span> <span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token property">&quot;myapp&quot;</span> <span class="token operator">:</span> <span class="token string">&quot;./cli.js&quot;</span> <span class="token punctuation">}</span>
  45. <span class="token punctuation">}</span>
  46. </code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br></div></div><p>模块安装的时候,若是全局安装,则npm会为bin中配置的文件在bin目录下创建一个软连接(对于windows系统,默认会在C:\Users\username\AppData\Roaming\npm目录下),若是局部安装,则会在项目内的./node_modules/.bin/目录下创建一个软链接。
  47. 因此,按上面的例子,当你安装myapp的时候,npm就会为cli.js在/usr/local/bin/myapp路径创建一个软链接。
  48. 如果你的模块只有一个可执行文件,并且它的命令名称和模块名称一样,你可以只写一个字符串来代替上面那种配置,例如:</p> <div class="language-json line-numbers-mode"><pre class="language-json"><code><span class="token punctuation">{</span>
  49. <span class="token property">&quot;name&quot;</span><span class="token operator">:</span> <span class="token string">&quot;my-program&quot;</span><span class="token punctuation">,</span>
  50. <span class="token property">&quot;version&quot;</span><span class="token operator">:</span> <span class="token string">&quot;1.2.5&quot;</span><span class="token punctuation">,</span>
  51. <span class="token property">&quot;bin&quot;</span><span class="token operator">:</span> <span class="token string">&quot;./path/to/program&quot;</span>
  52. <span class="token punctuation">}</span>
  53. </code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br></div></div><p>作用和如下写法相同:</p> <div class="language-json line-numbers-mode"><pre class="language-json"><code><span class="token punctuation">{</span>
  54. <span class="token property">&quot;name&quot;</span><span class="token operator">:</span> <span class="token string">&quot;my-program&quot;</span><span class="token punctuation">,</span>
  55. <span class="token property">&quot;version&quot;</span><span class="token operator">:</span> <span class="token string">&quot;1.2.5&quot;</span><span class="token punctuation">,</span>
  56. <span class="token property">&quot;bin&quot;</span> <span class="token operator">:</span> <span class="token punctuation">{</span>
  57. <span class="token property">&quot;my-program&quot;</span> <span class="token operator">:</span> <span class="token string">&quot;./path/to/program&quot;</span>
  58. <span class="token punctuation">}</span>
  59. <span class="token punctuation">}</span>
  60. </code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br></div></div><h2 id="man"><a href="#man" class="header-anchor">#</a> man</h2> <p>制定一个或通过数组制定一些文件来让linux下的man命令查找文档地址。
  61. 如果只有一个文件被指定的话,安装后直接使用man+模块名称,而不管man指定的文件的实际名称。例如:</p> <div class="language-json line-numbers-mode"><pre class="language-json"><code><span class="token punctuation">{</span>
  62. <span class="token property">&quot;name&quot;</span> <span class="token operator">:</span> <span class="token string">&quot;foo&quot;</span><span class="token punctuation">,</span>
  63. <span class="token property">&quot;version&quot;</span> <span class="token operator">:</span> <span class="token string">&quot;1.2.3&quot;</span><span class="token punctuation">,</span>
  64. <span class="token property">&quot;description&quot;</span> <span class="token operator">:</span> <span class="token string">&quot;A packaged foo fooer for fooing foos&quot;</span><span class="token punctuation">,</span>
  65. <span class="token property">&quot;main&quot;</span> <span class="token operator">:</span> <span class="token string">&quot;foo.js&quot;</span><span class="token punctuation">,</span>
  66. <span class="token property">&quot;man&quot;</span> <span class="token operator">:</span> <span class="token string">&quot;./man/doc.1&quot;</span>
  67. <span class="token punctuation">}</span>
  68. </code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br></div></div><p>通过man foo命令会得到 ./man/doc.1 文件的内容。
  69. 如果man文件名称不是以模块名称开头的,安装的时候会给加上模块名称前缀。因此,下面这段配置:</p> <div class="language-json line-numbers-mode"><pre class="language-json"><code><span class="token punctuation">{</span>
  70. <span class="token property">&quot;name&quot;</span> <span class="token operator">:</span> <span class="token string">&quot;foo&quot;</span><span class="token punctuation">,</span>
  71. <span class="token property">&quot;version&quot;</span> <span class="token operator">:</span> <span class="token string">&quot;1.2.3&quot;</span><span class="token punctuation">,</span>
  72. <span class="token property">&quot;description&quot;</span> <span class="token operator">:</span> <span class="token string">&quot;A packaged foo fooer for fooing foos&quot;</span><span class="token punctuation">,</span>
  73. <span class="token property">&quot;main&quot;</span> <span class="token operator">:</span> <span class="token string">&quot;foo.js&quot;</span><span class="token punctuation">,</span>
  74. <span class="token property">&quot;man&quot;</span> <span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token string">&quot;./man/foo.1&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;./man/bar.1&quot;</span> <span class="token punctuation">]</span>
  75. <span class="token punctuation">}</span>
  76. </code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br></div></div><p>会创建一些文件来作为man foo和man foo-bar命令的结果。
  77. man文件必须以数字结尾,或者如果被压缩了,以.gz结尾。数字表示文件将被安装到man的哪个部分。</p> <div class="language-json line-numbers-mode"><pre class="language-json"><code><span class="token punctuation">{</span>
  78. <span class="token property">&quot;name&quot;</span> <span class="token operator">:</span> <span class="token string">&quot;foo&quot;</span><span class="token punctuation">,</span>
  79. <span class="token property">&quot;version&quot;</span> <span class="token operator">:</span> <span class="token string">&quot;1.2.3&quot;</span><span class="token punctuation">,</span>
  80. <span class="token property">&quot;description&quot;</span> <span class="token operator">:</span> <span class="token string">&quot;A packaged foo fooer for fooing foos&quot;</span><span class="token punctuation">,</span>
  81. <span class="token property">&quot;main&quot;</span> <span class="token operator">:</span> <span class="token string">&quot;foo.js&quot;</span><span class="token punctuation">,</span>
  82. <span class="token property">&quot;man&quot;</span> <span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token string">&quot;./man/foo.1&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;./man/foo.2&quot;</span> <span class="token punctuation">]</span>
  83. <span class="token punctuation">}</span>
  84. </code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br></div></div><p>会创建 man foo 和 man 2 foo 两条命令。</p> <h2 id="directories"><a href="#directories" class="header-anchor">#</a> directories</h2> <p>CommonJs通过directories来制定一些方法来描述模块的结构,看看npm的package.json文件https://registry.npmjs.org/npm/latest ,可以发现里边有这个字段的内容。
  85. <img src="http://zoucz.com/blogimgs/2016-02-16/1455624810992.png" alt="img">
  86. 目前这个配置没有任何作用,将来可能会整出一些花样来。</p> <h3 id="directories-lib"><a href="#directories-lib" class="header-anchor">#</a> directories.lib</h3> <p>告诉用户模块中lib目录在哪,这个配置目前没有任何作用,但是对使用模块的人来说是一个很有用的信息。</p> <h3 id="directories-bin"><a href="#directories-bin" class="header-anchor">#</a> directories.bin</h3> <p>如果你在这里指定了bin目录,这个配置下面的文件会被加入到bin路径下,如果你已经在package.json中配置了bin目录,那么这里的配置将不起任何作用。</p> <h3 id="directories-man"><a href="#directories-man" class="header-anchor">#</a> directories.man</h3> <p>指定一个目录,目录里边都是man文件,这是一种配置man文件的语法糖。</p> <h3 id="directories-doc"><a href="#directories-doc" class="header-anchor">#</a> directories.doc</h3> <p>在这个目录里边放一些markdown文件,可能最终有一天它们会被友好的展现出来(应该是在npm的网站上)</p> <h3 id="directories-example"><a href="#directories-example" class="header-anchor">#</a> directories.example</h3> <p>放一些示例脚本,或许某一天会有用 - -!</p> <h2 id="repository"><a href="#repository" class="header-anchor">#</a> repository</h2> <p>指定一个代码存放地址,对想要为你的项目贡献代码的人有帮助。像这样:</p> <div class="language-json line-numbers-mode"><pre class="language-json"><code><span class="token property">&quot;repository&quot;</span> <span class="token operator">:</span>
  87. <span class="token punctuation">{</span>
  88. <span class="token property">&quot;type&quot;</span> <span class="token operator">:</span> <span class="token string">&quot;git&quot;</span><span class="token punctuation">,</span>
  89. <span class="token property">&quot;url&quot;</span> <span class="token operator">:</span> <span class="token string">&quot;https://github.com/npm/npm.git&quot;</span>
  90. <span class="token punctuation">}</span>
  91. <span class="token property">&quot;repository&quot;</span> <span class="token operator">:</span>
  92. <span class="token punctuation">{</span>
  93. <span class="token property">&quot;type&quot;</span> <span class="token operator">:</span> <span class="token string">&quot;svn&quot;</span><span class="token punctuation">,</span>
  94. <span class="token property">&quot;url&quot;</span> <span class="token operator">:</span> <span class="token string">&quot;https://v8.googlecode.com/svn/trunk/&quot;</span>
  95. <span class="token punctuation">}</span>
  96. </code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br></div></div><p>若你的模块放在GitHub, GitHub gist, Bitbucket, or GitLab的仓库里,npm install的时候可以使用缩写标记来完成:</p> <div class="language-json line-numbers-mode"><pre class="language-json"><code><span class="token property">&quot;repository&quot;</span><span class="token operator">:</span> <span class="token string">&quot;npm/npm&quot;</span>
  97. <span class="token property">&quot;repository&quot;</span><span class="token operator">:</span> <span class="token string">&quot;gist:11081aaa281&quot;</span>
  98. <span class="token property">&quot;repository&quot;</span><span class="token operator">:</span> <span class="token string">&quot;bitbucket:example/repo&quot;</span>
  99. <span class="token property">&quot;repository&quot;</span><span class="token operator">:</span> <span class="token string">&quot;gitlab:another/repo&quot;</span>
  100. </code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br></div></div><h2 id="scripts"><a href="#scripts" class="header-anchor">#</a> scripts</h2> <p>scripts属性是一个对象,里边指定了项目的生命周期个各个环节需要执行的命令。key是生命周期中的事件,value是要执行的命令。
  101. 具体的内容有 install start stop 等,详见<a href="https://docs.npmjs.com/misc/scripts" target="_blank" rel="noopener noreferrer"> https://docs.npmjs.com/misc/scripts<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <h2 id="config"><a href="#config" class="header-anchor">#</a> config</h2> <p>用来设置一些项目不怎么变化的项目配置,例如port等。
  102. 用户用的时候可以使用如下用法:</p> <div class="language-json line-numbers-mode"><pre class="language-json"><code>http.createServer(...).listen(process.env.npm_package_config_port)
  103. </code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>可以通过npm config set foo:port 80来修改config。详见<a href="https://docs.npmjs.com/misc/config" target="_blank" rel="noopener noreferrer">https://docs.npmjs.com/misc/config<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <div class="language-json line-numbers-mode"><pre class="language-json"><code><span class="token punctuation">{</span>
  104. <span class="token property">&quot;name&quot;</span> <span class="token operator">:</span> <span class="token string">&quot;foo&quot;</span><span class="token punctuation">,</span>
  105. <span class="token property">&quot;config&quot;</span> <span class="token operator">:</span> <span class="token punctuation">{</span> <span class="token property">&quot;port&quot;</span> <span class="token operator">:</span> <span class="token string">&quot;8080&quot;</span> <span class="token punctuation">}</span>
  106. <span class="token punctuation">}</span>
  107. </code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br></div></div><h2 id="dependencies"><a href="#dependencies" class="header-anchor">#</a> dependencies</h2> <p>dependencies属性是一个对象,配置模块依赖的模块列表,key是模块名称,value是版本范围,版本范围是一个字符,可以被一个或多个空格分割。
  108. dependencies也可以被指定为一个git地址或者一个压缩包地址。
  109. 不要把测试工具或transpilers写到dependencies中。 下面是一些写法,详见<a href="https://docs.npmjs.com/misc/semver" target="_blank" rel="noopener noreferrer">https://docs.npmjs.com/misc/semver<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <ul><li>version 精确匹配版本</li> <li>&gt;version 必须大于某个版本</li> <li>&gt;=version 大于等于</li> <li>&lt;version 小于</li> <li>&lt;=versionversion 小于</li> <li>~version &quot;约等于&quot;,具体规则详见semver文档</li> <li>^version &quot;兼容版本&quot;具体规则详见semver文档</li> <li>1.2.x 仅一点二点几的版本</li> <li>http://... 见下面url作为denpendencies的说明</li> <li><ul><li>任何版本</li></ul></li> <li>&quot;&quot; 空字符,和*相同</li> <li>version1 - version2 相当于 &gt;=version1 &lt;=version2.</li> <li>range1 || range2 范围1和范围2满足任意一个都行</li> <li>git... 见下面git url作为denpendencies的说明</li> <li>user/repo See 见下面GitHub仓库的说明</li> <li>tag 发布的一个特殊的标签,见npm-tag的文档 <a href="https://docs.npmjs.com/getting-started/using-tags" target="_blank" rel="noopener noreferrer">https://docs.npmjs.com/getting-started/using-tags<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li>path/path/path 见下面本地模块的说明
  110. 下面的写法都是可以的:</li></ul> <div class="language-json line-numbers-mode"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">&quot;dependencies&quot;</span> <span class="token operator">:</span>
  111. <span class="token punctuation">{</span> <span class="token property">&quot;foo&quot;</span> <span class="token operator">:</span> <span class="token string">&quot;1.0.0 - 2.9999.9999&quot;</span>
  112. <span class="token punctuation">,</span> <span class="token property">&quot;bar&quot;</span> <span class="token operator">:</span> <span class="token string">&quot;&gt;=1.0.2 &lt;2.1.2&quot;</span>
  113. <span class="token punctuation">,</span> <span class="token property">&quot;baz&quot;</span> <span class="token operator">:</span> <span class="token string">&quot;&gt;1.0.2 &lt;=2.3.4&quot;</span>
  114. <span class="token punctuation">,</span> <span class="token property">&quot;boo&quot;</span> <span class="token operator">:</span> <span class="token string">&quot;2.0.1&quot;</span>
  115. <span class="token punctuation">,</span> <span class="token property">&quot;qux&quot;</span> <span class="token operator">:</span> <span class="token string">&quot;&lt;1.0.0 || &gt;=2.3.1 &lt;2.4.5 || &gt;=2.5.2 &lt;3.0.0&quot;</span>
  116. <span class="token punctuation">,</span> <span class="token property">&quot;asd&quot;</span> <span class="token operator">:</span> <span class="token string">&quot;http://asdf.com/asdf.tar.gz&quot;</span>
  117. <span class="token punctuation">,</span> <span class="token property">&quot;til&quot;</span> <span class="token operator">:</span> <span class="token string">&quot;~1.2&quot;</span>
  118. <span class="token punctuation">,</span> <span class="token property">&quot;elf&quot;</span> <span class="token operator">:</span> <span class="token string">&quot;~1.2.3&quot;</span>
  119. <span class="token punctuation">,</span> <span class="token property">&quot;two&quot;</span> <span class="token operator">:</span> <span class="token string">&quot;2.x&quot;</span>
  120. <span class="token punctuation">,</span> <span class="token property">&quot;thr&quot;</span> <span class="token operator">:</span> <span class="token string">&quot;3.3.x&quot;</span>
  121. <span class="token punctuation">,</span> <span class="token property">&quot;lat&quot;</span> <span class="token operator">:</span> <span class="token string">&quot;latest&quot;</span>
  122. <span class="token punctuation">,</span> <span class="token property">&quot;dyl&quot;</span> <span class="token operator">:</span> <span class="token string">&quot;file:../dyl&quot;</span>
  123. <span class="token punctuation">}</span>
  124. <span class="token punctuation">}</span>
  125. </code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br></div></div><h2 id="urls-as-dependencies"><a href="#urls-as-dependencies" class="header-anchor">#</a> URLs as Dependencies</h2> <p>在版本范围的地方可以写一个url指向一个压缩包,模块安装的时候会把这个压缩包下载下来安装到模块本地。</p> <h2 id="git-urls-as-dependencies"><a href="#git-urls-as-dependencies" class="header-anchor">#</a> Git URLs as Dependencies</h2> <p>Git url可以像下面一样:</p> <div class="language- line-numbers-mode"><pre class="language-text"><code>git://github.com/user/project.git#commit-ish
  126. git+ssh://user@hostname:project.git#commit-ish
  127. git+ssh://user@hostname/project.git#commit-ish
  128. git+http://user@hostname/project/blah.git#commit-ish
  129. git+https://user@hostname/project/blah.git#commit-ish
  130. </code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br></div></div><p>commit-ish 可以是任意标签,哈希值,或者可以检出的分支,默认是master分支。</p> <h2 id="github-urls"><a href="#github-urls" class="header-anchor">#</a> GitHub URLs</h2> <p>支持github的 username/modulename 的写法,#后边可以加后缀写明分支hash或标签:</p> <div class="language-json line-numbers-mode"><pre class="language-json"><code><span class="token punctuation">{</span>
  131. <span class="token property">&quot;name&quot;</span><span class="token operator">:</span> <span class="token string">&quot;foo&quot;</span><span class="token punctuation">,</span>
  132. <span class="token property">&quot;version&quot;</span><span class="token operator">:</span> <span class="token string">&quot;0.0.0&quot;</span><span class="token punctuation">,</span>
  133. <span class="token property">&quot;dependencies&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span>
  134. <span class="token property">&quot;express&quot;</span><span class="token operator">:</span> <span class="token string">&quot;visionmedia/express&quot;</span><span class="token punctuation">,</span>
  135. <span class="token property">&quot;mocha&quot;</span><span class="token operator">:</span> <span class="token string">&quot;visionmedia/mocha#4727d357ea&quot;</span>
  136. <span class="token punctuation">}</span>
  137. <span class="token punctuation">}</span>
  138. </code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br></div></div><h2 id="local-paths"><a href="#local-paths" class="header-anchor">#</a> Local Paths</h2> <p>npm2.0.0版本以上可以提供一个本地路径来安装一个本地的模块,通过npm install xxx --save 来安装,格式如下:</p> <div class="language- line-numbers-mode"><pre class="language-text"><code>../foo/bar
  139. ~/foo/bar
  140. ./foo/bar
  141. /foo/bar
  142. </code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br></div></div><p>package.json 生成的相对路径如下:</p> <div class="language-json line-numbers-mode"><pre class="language-json"><code><span class="token punctuation">{</span>
  143. <span class="token property">&quot;name&quot;</span><span class="token operator">:</span> <span class="token string">&quot;baz&quot;</span><span class="token punctuation">,</span>
  144. <span class="token property">&quot;dependencies&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span>
  145. <span class="token property">&quot;bar&quot;</span><span class="token operator">:</span> <span class="token string">&quot;file:../foo/bar&quot;</span>
  146. <span class="token punctuation">}</span>
  147. <span class="token punctuation">}</span>
  148. </code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br></div></div><p>这种属性在离线开发或者测试需要用npm install的情况,又不想自己搞一个npm server的时候有用,但是发布模块到公共仓库时不应该使用这种属性。</p> <h2 id="devdependencies"><a href="#devdependencies" class="header-anchor">#</a> devDependencies</h2> <p>如果有人想要下载并使用你的模块,也许他们并不希望或需要下载一些你在开发过程中使用的额外的测试或者文档框架。
  149. 在这种情况下,最好的方法是把这些依赖添加到devDependencies属性的对象中。
  150. 这些模块会在npm link或者npm install的时候被安装,也可以像其他npm配置一样被管理,详见npm的config文档。
  151. 对于一些跨平台的构建任务,例如把CoffeeScript编译成JavaScript,就可以通过在package.json的script属性里边配置prepublish脚本来完成这个任务,然后需要依赖的coffee-script模块就写在devDependencies属性种。
  152. 例如:</p> <div class="language-json line-numbers-mode"><pre class="language-json"><code><span class="token punctuation">{</span> <span class="token property">&quot;name&quot;</span><span class="token operator">:</span> <span class="token string">&quot;ethopia-waza&quot;</span><span class="token punctuation">,</span>
  153. <span class="token property">&quot;description&quot;</span><span class="token operator">:</span> <span class="token string">&quot;a delightfully fruity coffee varietal&quot;</span><span class="token punctuation">,</span>
  154. <span class="token property">&quot;version&quot;</span><span class="token operator">:</span> <span class="token string">&quot;1.2.3&quot;</span><span class="token punctuation">,</span>
  155. <span class="token property">&quot;devDependencies&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span>
  156. <span class="token property">&quot;coffee-script&quot;</span><span class="token operator">:</span> <span class="token string">&quot;~1.6.3&quot;</span>
  157. <span class="token punctuation">}</span><span class="token punctuation">,</span>
  158. <span class="token property">&quot;scripts&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span>
  159. <span class="token property">&quot;prepublish&quot;</span><span class="token operator">:</span> <span class="token string">&quot;coffee -o lib/ -c src/waza.coffee&quot;</span>
  160. <span class="token punctuation">}</span><span class="token punctuation">,</span>
  161. <span class="token property">&quot;main&quot;</span><span class="token operator">:</span> <span class="token string">&quot;lib/waza.js&quot;</span>
  162. <span class="token punctuation">}</span>
  163. </code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br></div></div><p>prepublish脚本会在发布之前运行,因此用户在使用之前就不用再自己去完成编译的过程了。在开发模式下,运行npm install也会执行这个脚本(见npm script文档),因此可以很方便的调试。</p> <h2 id="peerdependencies"><a href="#peerdependencies" class="header-anchor">#</a> peerDependencies</h2> <p>有时候做一些插件开发,比如grunt等工具的插件,它们往往是在grunt的某个版本的基础上开发的,而在他们的代码中并不会出现require(&quot;grunt&quot;)这样的依赖,dependencies配置里边也不会写上grunt的依赖,为了说明此模块只能作为插件跑在宿主的某个版本范围下,可以配置peerDependencies:</p> <div class="language-json line-numbers-mode"><pre class="language-json"><code><span class="token punctuation">{</span>
  164. <span class="token property">&quot;name&quot;</span><span class="token operator">:</span> <span class="token string">&quot;tea-latte&quot;</span><span class="token punctuation">,</span>
  165. <span class="token property">&quot;version&quot;</span><span class="token operator">:</span> <span class="token string">&quot;1.3.5&quot;</span><span class="token punctuation">,</span>
  166. <span class="token property">&quot;peerDependencies&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span>
  167. <span class="token property">&quot;tea&quot;</span><span class="token operator">:</span> <span class="token string">&quot;2.x&quot;</span>
  168. <span class="token punctuation">}</span>
  169. <span class="token punctuation">}</span>
  170. </code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br></div></div><p>上面这个配置确保再npm install的时候tea-latte会和2.x版本的tea一起安装,而且它们两个的依赖关系是同级的:
  171. ├── tea-latte@1.3.5
  172. └── tea@2.2.0
  173. 这个配置的目的是让npm知道,如果要使用此插件模块,请确保安装了兼容版本的宿主模块。</p> <h2 id="bundleddependencies"><a href="#bundleddependencies" class="header-anchor">#</a> bundledDependencies</h2> <p>上面的单词少个d,写成bundleDependencies也可以。
  174. 指定发布的时候会被一起打包的模块。</p> <h2 id="optionaldependencies"><a href="#optionaldependencies" class="header-anchor">#</a> optionalDependencies</h2> <p>如果一个依赖模块可以被使用, 同时你也希望在该模块找不到或无法获取时npm继续运行,你可以把这个模块依赖放到optionalDependencies配置中。这个配置的写法和dependencies的写法一样,不同的是这里边写的模块安装失败不会导致npm install失败。
  175. 当然,这种模块就需要你自己在代码中处理模块确实的情况了,例如:</p> <div class="language-js line-numbers-mode"><pre class="language-js"><code><span class="token keyword">try</span> <span class="token punctuation">{</span>
  176. <span class="token keyword">var</span> foo <span class="token operator">=</span> <span class="token function">require</span><span class="token punctuation">(</span><span class="token string">'foo'</span><span class="token punctuation">)</span>
  177. <span class="token keyword">var</span> fooVersion <span class="token operator">=</span> <span class="token function">require</span><span class="token punctuation">(</span><span class="token string">'foo/package.json'</span><span class="token punctuation">)</span><span class="token punctuation">.</span>version
  178. <span class="token punctuation">}</span> <span class="token keyword">catch</span> <span class="token punctuation">(</span>er<span class="token punctuation">)</span> <span class="token punctuation">{</span>
  179. foo <span class="token operator">=</span> <span class="token keyword">null</span>
  180. <span class="token punctuation">}</span>
  181. <span class="token keyword">if</span> <span class="token punctuation">(</span> <span class="token function">notGoodFooVersion</span><span class="token punctuation">(</span>fooVersion<span class="token punctuation">)</span> <span class="token punctuation">)</span> <span class="token punctuation">{</span>
  182. foo <span class="token operator">=</span> <span class="token keyword">null</span>
  183. <span class="token punctuation">}</span>
  184. <span class="token comment">// .. then later in your program ..</span>
  185. <span class="token keyword">if</span> <span class="token punctuation">(</span>foo<span class="token punctuation">)</span> <span class="token punctuation">{</span>
  186. foo<span class="token punctuation">.</span><span class="token function">doFooThings</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
  187. <span class="token punctuation">}</span>
  188. </code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br></div></div><p>optionalDependencies 中的配置会覆盖dependencies中的配置,最好只在一个地方写。</p> <h2 id="engines"><a href="#engines" class="header-anchor">#</a> engines</h2> <p>你可以指定项目运行的node版本范围,如下:
  189. { &quot;engines&quot; : { &quot;node&quot; : &quot;&gt;=0.10.3 &lt;0.12&quot; } }
  190. 和dependencies一样,如果你不指定版本范围或者指定为*,任何版本的node都可以。
  191. 也可以指定一些npm版本可以正确的安装你的模块,例如:
  192. { &quot;engines&quot; : { &quot;npm&quot; : &quot;~1.0.20&quot; } }
  193. 要注意的是,除非你设置了engine-strict属性,engines属性是仅供参考的。</p> <h2 id="enginestrict"><a href="#enginestrict" class="header-anchor">#</a> engineStrict</h2> <p>注意:这个属性已经弃用,将在npm 3.0.0 版本干掉。</p> <h2 id="os"><a href="#os" class="header-anchor">#</a> os</h2> <p>可以指定你的模块只能在哪个操作系统上跑:
  194. &quot;os&quot; : [ &quot;darwin&quot;, &quot;linux&quot; ]
  195. 也可以指定黑名单而不是白名单:
  196. &quot;os&quot; : [ &quot;!win32&quot; ]
  197. 服务的操作系统是由process.platform来判断的,这个属性允许黑白名单同时存在,虽然没啥必要这样搞...</p> <h2 id="cpu"><a href="#cpu" class="header-anchor">#</a> cpu</h2> <p>限制模块只能在某某cpu架构下运行
  198. &quot;cpu&quot; : [ &quot;x64&quot;, &quot;ia32&quot; ]
  199. 同样可以设置黑名单:
  200. &quot;cpu&quot; : [ &quot;!arm&quot;, &quot;!mips&quot; ]
  201. cpu架构通过 process.arch 判断</p> <h2 id="preferglobal"><a href="#preferglobal" class="header-anchor">#</a> preferGlobal</h2> <p>如果您的软件包主要用于安装到全局的命令行应用程序,那么该值设置为true ,如果它被安装在本地,则提供一个警告。实际上该配置并没有阻止用户把模块安装到本地,只是防止该模块被错误的使用引起一些问题。</p> <h2 id="private"><a href="#private" class="header-anchor">#</a> private</h2> <p>如果这个属性被设置为true,npm将拒绝发布它,这是为了防止一个私有模块被无意间发布出去。如果你只想让模块被发布到一个特定的npm仓库,如一个内部的仓库,可与在下面的publishConfig中配置仓库参数。</p> <h2 id="publishconfig"><a href="#publishconfig" class="header-anchor">#</a> publishConfig</h2> <p>这个配置是会在模块发布时用到的一些值的集合。如果你不想模块被默认被标记为最新的,或者默认发布到公共仓库,可以在这里配置tag或仓库地址。</p> <h2 id="default-values"><a href="#default-values" class="header-anchor">#</a> DEFAULT VALUES</h2> <p>npm设置了一些默认参数,如:
  202. &quot;scripts&quot;: {&quot;start&quot;: &quot;node server.js&quot;}
  203. 如果模块根目录下有一个server.js文件,那么npm start会默认运行这个文件。
  204. &quot;scripts&quot;:{&quot;preinstall&quot;: &quot;node-gyp rebuild&quot;}
  205. 如果模块根目录下有binding.gyp, npm将默认用node-gyp来编译preinstall的脚本
  206. &quot;contributors&quot;: [...]
  207. 若模块根目录下有AUTHORS 文件,则npm会按Name (url)格式解析每一行的数据添加到contributors中,可以用#添加行注释</p> <h2 id="参考文档列表-https-docs-npmjs-com"><a href="#参考文档列表-https-docs-npmjs-com" class="header-anchor">#</a> 参考文档列表(https://docs.npmjs.com/)</h2> <p>semver(7)
  208. npm-init(1)
  209. npm-version(1)
  210. npm-config(1)
  211. npm-config(7)
  212. npm-help(1)
  213. npm-faq(7)
  214. npm-install(1)
  215. npm-publish(1)
  216. npm-rm(1)</p></div></div> <div class="page-edit"><div class="edit-link"><a href="https://github.com/heBody/blog/edit/master/docs/03.技术/01.技术文档/10.npm packageJson属性详解.md" target="_blank" rel="noopener noreferrer">编辑</a> <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></div> <!----> <div class="last-updated"><span class="prefix">上次更新:</span> <span class="time">2022/12/14, 19:36:42</span></div></div> <div class="page-nav-wapper"><div class="page-nav-centre-wrap"><a href="/blog/pages/61f2f95fd7da14fd/" class="page-nav-centre page-nav-centre-prev"><div class="tooltip">npm常用命令</div></a> <a href="/blog/pages/4e8444e2d534d14f/" class="page-nav-centre page-nav-centre-next"><div class="tooltip">yaml语言教程</div></a></div> <div class="page-nav"><p class="inner"><span class="prev">
  217. <a href="/blog/pages/61f2f95fd7da14fd/" class="prev">npm常用命令</a></span> <span class="next"><a href="/blog/pages/4e8444e2d534d14f/">yaml语言教程</a>→
  218. </span></p></div></div></div> <div class="article-list"><div class="article-title"><a href="/blog/archives/" class="iconfont icon-bi">最近更新</a></div> <div class="article-wrapper"><dl><dd>01</dd> <dt><a href="/blog/pages/922650/"><div>
  219. Git修改分支名
  220. <!----></div></a> <span class="date">08-11</span></dt></dl><dl><dd>02</dd> <dt><a href="/blog/pages/55f894/"><div>
  221. CSS给table的tbody添加滚动条
  222. <!----></div></a> <span class="date">06-29</span></dt></dl><dl><dd>03</dd> <dt><a href="/blog/pages/829589/"><div>
  223. 我做了一个手写春联小网页,祝大家虎年暴富
  224. <span class="title-tag">
  225. 原创
  226. </span></div></a> <span class="date">01-28</span></dt></dl> <dl><dd></dd> <dt><a href="/blog/archives/" class="more">更多文章&gt;</a></dt></dl></div></div></main></div> <div class="footer"><div class="icons"><a href="mailto:30363811@qq.com" title="发邮件" target="_blank" class="iconfont icon-youjian"></a><a href="https://github.com/heBody" title="GitHub" target="_blank" class="iconfont icon-github"></a></div>
  227. Copyright © 2016-2022
  228. <span>Hesb | <a href="https://github.com/heBody/blob" target="_blank">MIT License</a></span></div> <div class="buttons"><div title="返回顶部" class="button blur go-to-top iconfont icon-fanhuidingbu" style="display:none;"></div> <div title="去评论" class="button blur go-to-comment iconfont icon-pinglun" style="display:none;"></div> <div title="主题模式" class="button blur theme-mode-but iconfont icon-zhuti"><ul class="select-box" style="display:none;"><li class="iconfont icon-zidong">
  229. 跟随系统
  230. </li><li class="iconfont icon-rijianmoshi">
  231. 浅色模式
  232. </li><li class="iconfont icon-yejianmoshi">
  233. 深色模式
  234. </li><li class="iconfont icon-yuedu">
  235. 阅读模式
  236. </li></ul></div></div> <!----> <!----> <!----></div><div class="global-ui"><div></div></div></div>
  237. <script src="/blog/assets/js/app.5c136166.js" defer></script><script src="/blog/assets/js/2.c241a1b0.js" defer></script><script src="/blog/assets/js/3.6748bd5c.js" defer></script><script src="/blog/assets/js/54.dbb7c9ab.js" defer></script>
  238. </body>
  239. </html>