Là một dự án mã nguồn mở, http-party/registry-mock đã đạt 0 sao trên GitHub, ngôn ngữ JavaScript.
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
var registryMock = require('registry-mock');
registryMock({ http: 8080 }, (err, registry) => {
if (err) { /* handle me */ }
console.log('Mock npm registry listening on 8080');
});
registry-mock is designed to be a generic caching HTTP server for asserting that proxied
npm registry HTTP calls send the correct payloads and/or headers to the target registry.
In order to test some npm-specific routes (such as publish) it is necessary to cache tarballs
and later serve them.
HTTP & cache conventions
The response to incoming requests can be summarized based on a few simple rules:
All requests to /.*tgz or those with the X-FETCH-CACHE header
respond with the last request body received for that route.
If there is no cache for that route a 404 is served.
If X-CLEAR-CACHE is provided to a cache hit request, then
the cache is cleared for that route.
All other requests are cached for future assertion
and the response is given from the JSON parsed
X-SEND-RESPONSE header:
npm publish PUT /:pkg splits out the tarball and makes
the cache for /:pkg/-/:pkg-:version.tgz available for
download.
Using npm-registry-echo
This package also ships a binary named npm-registry-echo this program runs a simple
registry-mock server and then fetches the cache immediately after all requests. This
allows for simple introspection of the payloads that are sent from the npm CLI.
e.g. Viewing npm publish payloads
1. Running npm-registry-echo
$ npm i -g registry-mock
$ npm-registry-echo
npm-registry-echo listening on 3676
PUT /test-publish03 {"_id":"test-publish03","name":"test-publish03","description":"Just a
test","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"test-publish03","version":
"1.0.0","description":"Just a test","main":"index.js","scripts":{"test":"echo \"Error: no test
specified\" && exit 1"},"author":"","license":"ISC","readme":"ERROR: No README data found!",
"_id":"[email protected]","_shasum":"6e78734fff0347a9596abb5d3b0360fda6f1a899","_from":".",
"_npmVersion":"3.7.1","_nodeVersion":"4.2.2","_npmUser":{"name":"garbage!!user","email":
"[email protected]"},"maintainers":[{"name":"garbage!!user","email":"[email protected]"}],
"dist":{"shasum":"6e78734fff0347a9596abb5d3b0360fda6f1a899","tarball":
"http://localhost:3676/test-publish03/-/test-publish03-1.0.0.tgz"}}},"readme":"ERROR:
No README data found!","maintainers":[{"name":"garbage!!user","email":"[email protected]"}],
"_attachments":{"test-publish03-1.0.0.tgz":{"content_type":"application/octet-stream",
"data":"{{BIG-BASE64-TARBALL}}","length":568}}}
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/http-party/registry-mock là nguồn chính thức.
http-party/registry-mock có phải mã nguồn mở không?
Có — http-party/registry-mock phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/http-party/registry-mock.
http-party/registry-mock là gì?
http-party/registry-mock (http-party/registry-mock) là dự án JavaScript TopGit theo dõi. Tính tới lần đồng bộ gần nhất, repo có 0 sao.
Đọc đầy đủ README ở tab phía trên.
Chưa chắc registry-mock có hợp với bạn?
Để ChatGPT, Claude hoặc Perplexity tìm hiểu giúp — bấm bên dưới và xem AI nói gì về registry-mock.