1. <strong id="7actg"></strong>
    2. <table id="7actg"></table>

    3. <address id="7actg"></address>
      <address id="7actg"></address>
      1. <object id="7actg"><tt id="7actg"></tt></object>

        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)
        1. <strong id="7actg"></strong>
        2. <table id="7actg"></table>

        3. <address id="7actg"></address>
          <address id="7actg"></address>
          1. <object id="7actg"><tt id="7actg"></tt></object>
            成人区视频| 欧美无砖砖区免费 | 亚洲a级大片 | 亚洲无码免费网站 | 日本人妻A片成人免费看片 | 日本三级欧美三级人妇视频黑白 | 人人操天天摸 | 91精品国产色综合久久不卞臂 | 激情高潮av | 色婷婷性爱 |