<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          tiny-package-managerLearn how npm or Yarn v1 works.

          聯(lián)合創(chuàng)作 · 2023-09-22 21:17

          Tiny Package Manager

          A very very simple demo and guide for explaining package manager.

          Introduction

          As a JavaScript developer, you may use package manager like npm or Yarn frequently.

          However, do you know how a package manager works? Or, you may be curious about how to build a package manager.

          Well, the purpose of this guide is not to let you re-invent a new wheel. There is no need to do that because both npm and Yarn are mature and stable enough. The purpose is just to explain how a package manager works under the hood. You can read the code, and the comments will explain how it works.

          Note: To simplify the guide and make it as simple as possible, this demo doesn't handle some edge cases and catch errors and exceptions. If you are really curious about that, it's recommended to read the source code of npm or Yarn.

          Features

          • Download packages to node_modules directory.
          • Simple CLI.
          • Simply resolve dependency conflicts.
          • Flatten dependencies tree.
          • Support lock file. (Like yarn.lock or package-lock.json)
          • Add a new package through CLI. (Like yarn add or npm i <package> command)
          • Run lifecycle scripts. (preinstall and postinstall)
          • Symlink the bin files.

          How to start?

          Read the source code in the src directory. You can read the src/index.ts file in the beginning.

          If you would like to try this simple package manager, just install it globally:

          Via Yarn:

          $ yarn global add tiny-package-manager
          

          Via npm:

          $ npm i -g tiny-package-manager
          

          Then just go to a directory which contains valid package.json and run:

          $ tiny-pm
          

          License

          MIT License (c) 2018-present Pig Fang

          瀏覽 12
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          評(píng)論
          圖片
          表情
          推薦
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  成人网站无人区一区二区三区 | 久99久在线观看视频 | 日日夜夜三级电影网站 | 羞羞色院91蜜桃 | 无码人妻丰满熟妇精品 |