npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

local-web-test

v1.0.2

Published

quickly bulid local test server

Downloads

7

Readme

Chinese

local-web-test

local-web-test 一个本地的基于node.js的测试服务器 支持快速的启动web容器服务 支持快速的发送get,post请求,并记录在/log文件夹下,并在控制台输出 支持一个函数完成cors跨域请求

Install

npm install --save local-web-test

Usage

创建本地静态服务器

第一个参数为静态文件地址,第二个参数为端口号 eg;

var test = require('local-web-test');
test.static('./', 3344);

创建get请求

get请求打印在控制台,并写入文件./log/data.js 第一个参数为url,第二个参数为端口号 eg;

var test = require('local-web-test');
test.get('./', 3344);

创建post请求

将post请求打印 第一个参数为post地址,第二个参数为端口号,将会把读取的JSON数据输出在控制台,并写入文件中,文件路径为 ./log/data.json eg

var test = require('local-web-test');
test.post('./', 3344);

Cors

创建get Cors请求

get请求打印在控制台,并写入文件./log/data.js 第一个参数为get地址,第二个参数为端口号,将会把读取的JSON数据输出在控制台,并写入文件中,文件路径为log/data.json, 第三个参数为cors域名,默认支持发送cookice eg:

var test = require('local-web-test');
test.getCors('./', 3344, '*');

创建post请求

将post请求打印 第一个参数为post地址,第二个参数为端口号,将会把读取的JSON数据输出在控制台,并写入文件中,文件路径为 ./log/data.json,第三个参数为cors域名 eg

var test = require('local-web-test');
test.post('./', 3344, '*');

更新记录

2018年08月17日 1.0.0 2018年08月17日 1.0.1 增加英文文档(虽然是机翻的,并没有什么用处╮(╯▽╰)╭) 2018年08月19日 1.0.2 更改路径错误 添加测试用例

依赖

该包依赖于body-parser cookie-parser express multer

鸣谢

没有人╮(╯▽╰)╭

English

local-web-test

local-web-test a local node.js based test server Support for fast startup web container services Support fast send get, post request, and record in the /log folder, and output in the console Support a function to complete cors cross-domain request

Install

npm install --save local-web-test

Usage

Create a local static server

The first parameter is the static file address, and the second parameter is the port number. eg;

var test = require('local-web-test');
test.static('./', 3344);

Create a get request

The get request is printed on the console and written to the file ./log/data.js The first parameter is url and the second parameter is port number.

eg;

var test = require('local-web-test');
test.get('./', 3344);

Create a post request

Print post request The first parameter is the post address, and the second parameter is the port number. The read JSON data will be output to the console and written to the file. The file path is ./log/data.json eg

var test = require('local-web-test');
test.post('./', 3344);

Cors

Create a get Cors request

The get request is printed on the console and written to the file ./log/data.js The first parameter is the get address, and the second parameter is the port number. The read JSON data will be output to the console and written to the file. The file path is log/data.json, and the third parameter is cors. Domain name, default support for sending cookice eg:

var test = require('local-web-test');
test.getCors('./', 3344, '*');

Create a post request

Print post request The first parameter is the post address, and the second parameter is the port number. The read JSON data will be output to the console and written to the file. The file path is ./log/data.json, the third parameter. Cors domain name eg

var test = require('local-web-test');
test.post('./', 3344, '*');

update record

August 17, 2018 1.0.0 August 17, 2018 1.0.1 Adding English documents (although it is machine-turned, it has no use (╮)╭) August 19, 2018 1.0.2 Change path error Add test case

rely

This package depends on the body-parser cookie-parser express multer

Acknowledgement

No one is ╮(╯▽╰)╭