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

@feidao-works/webtest-web

v1.0.201901260943

Published

示例项目

Downloads

4

Readme

开发步骤

准备

环境

Node.js安装

项目

下载依赖包

yarn

页面开发

运行命令

npm t

服务依赖

如xxx是生成验证码原子操作依赖的,需要添加到项目中,方法为:

  1. 安装依赖

    cnpm i xxx -D
  2. 项目依赖package-service.json添加

"dependencies": {
	"xxx": "*"
}

项目发布

一键发布

./publish.sh

第三方依赖

导出pdf

  • 参数
    • orientation pdf版式('landscape': 横版,'portrait': 竖版;默认是竖版)
    • attachment pdf文件名称(完整文件名称,例如:ceshi.pdf)
import render from '@feidao-factory/atom/nodejs/render/render';
// 在页面上显示pdf文件内容,则不能传入参数attachment

// 要展示的pdf为横版
const url = 'http://192.168.40.196/flippedclass/print.pdf?orientation=landscape';

// 竖版
const url = 'http://192.168.40.196/flippedclass/print.pdf?orientation=portrait';
const url = 'http://192.168.40.196/flippedclass/print.pdf';

// 直接对pdf文件进行下载,需传入参数attachment
const url = 'http://192.168.40.196/flippedclass/print.pdf?attachment=ceshi.pdf';

// 渲染
render(fd.data.node, url, '<a href={{=it}}>docx</a>', 'p01');
  • 名称

    • jsreport-phantom-pdf
    • jsreport-core
    • inline-source
  • 安装

yarn add jsreport-phantom-pdf inline-source jsreport-core

导出xlsx

  • 参数
    • attachment excel文件名称(完整文件名称,例如:ceshi.xlsx)
import render from '@feidao-factory/atom/nodejs/render/render';
// 指定下载文件名称
const url = 'http://192.168.40.196/flippedclass/print.xlsx?attachment=ceshi.xlsx';

// 文件名称无需制定,下载为本页面的名陈'print.xlsx'
const url = 'http://192.168.40.196/flippedclass/print.xlsx';

// 渲染
render(fd.data.node, url, '<a href={{=it}}>docx</a>', 'p01');
  • 名称

    • jsreport-html-to-xlsx
    • jsreport-xlsx
    • inline-source
    • jsreport-core
  • 安装

yarn add jsreport-html-to-xlsx jsreport-xlsx inline-source jsreport-core

导出docx

  • 参数
    • attachment docx文件名称(完整文件名称,例如:ceshi.docx)
import render from '@feidao-factory/atom/nodejs/render/render';
// 指定下载文件名称
const url = 'http://192.168.40.196/flippedclass/print.docx?attachment=ceshi.docx';

// 文件名称无需制定,下载为本页面的名陈'print.docx'
const url = 'http://192.168.40.196/flippedclass/print.docx';

// 渲染
render(fd.data.node, url, '<a href={{=it}}>docx</a>', 'p01');
  • 名称

    • inline-source
    • jsreport-core
    • jsreport-html-embedded-in-docx
  • 安装

yarn add jsreport-html-embedded-in-docx inline-source jsreport-core

服务导出excel

  • 暂时使用的第三方库为exceljs

  • 服务完成后本地测试需配置

    • 配置的文件为:feidao-server.json
{
	"URL": "@访问地址@",
	"METHOD": "get",
	"SERVICE": "dataservice.nodejs",
	"DATA": {
		"modelid": "custom::js_@文件路径+文件名@"
	}
}
  • 注意,配置访问地址不能和文件feidao-server.json中已有的地址重复
  • 配置之后,重新启动服务,本地测试路径为:http://127.0.0.1:8889/@访问地址@
  • 打包之后请求的地址为:'./@访问地址@'
yarn add exceljs

服务导出doc

  • 暂时使用的第三方库为docx

  • 服务完成后本地测试需配置

    • 配置的文件为:feidao-server.json
{
	"URL": "@访问地址@",
	"METHOD": "get",
	"SERVICE": "dataservice.nodejs",
	"DATA": {
		"modelid": "custom::js_@文件路径+文件名@"
	}
}
  • 注意,配置访问地址不能和文件feidao-server.json中已有的地址重复
  • 配置之后,重新启动服务,本地测试路径为:http://127.0.0.1:8889/@访问地址@
  • 打包之后请求的地址为:'./@访问地址@'
yarn add docx