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 🙏

© 2025 – Pkg Stats / Ryan Hefner

persagy_electron

v1.0.8-beta.11

Published

博锐尚格浏览器端项目和Electron快速集成工具

Downloads

78

Readme

persagy_electron

备注及第三方库版本号说明

1、需把镜像源切换到taobao
	切换方法,先安装nrm 然后使用nrm use taobao
2、第三方库说明
	nodejs需大于14.0
	"electron":"12.0.1",
	"electron-packager":"15.2.0",
	"body-parser": "1.19.0",
	"ejs": "^3.1.5",
	"express": "4.17.1",
	"log4js": "^6.3.0",
	"request": "^2.88.2",
	"ffi-napi":"3.1.0",
	"extract-zip": "^2.0.1"

安装

1.打开cmd命令窗口
2.cd到要使用persagy_electron的项目目录
3.查看npx是否可用 
	输入命令 npm -v			查看npm版本信息,版本需>=5.2
	输入命令 npx -v 		输出版本信息的话代表npx命令可用,否则请执行 npm install -g npx
4.执行命令:
	npx persagy_electron
	persagy_electron为模块名称

运行

开发环境

	1.cd 到项目根目录下,执行:npm run electron_dev
	2.在vs_code里,点击 运行 ->  调试

生产环境

	找到打包的生成目录,运行其内的项目名称.exe文件即可,该exe文件的运行不依赖node等环境,即:电脑上没有安装node环境,依然可运行该exe文件

设置vscode调试

vscode顶部点击 运行 -> 打开配置 ->NodeJs环境     把以下配置复制进去,覆盖掉已有的全部配置

{
	// 使用 IntelliSense 了解相关属性。 
	// 悬停以查看现有属性的描述。
	// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
	"version": "0.2.0",
	"configurations": [
		{
			"type": "node",
			"request": "launch",
			"name": "启动程序",
			"cwd": "${workspaceFolder}",
			"runtimeExecutable": "npm",
			"runtimeArgs": ["run","electron_dev"],
			//跟踪调试对象的所有子过程,并自动附加到在调试模式下启动的子过程
			"autoAttachChildProcesses": true,
			//自动断点到第一行代码处
			"stopOnEntry": false
		  }
	]
}

打包

cd到项目根目录下,执行:npm run electron_build_win   会对项目进行打包,默认生成到项目根目录下的electronBuild目录内

配置说明

开发环境下的配置位于  electron_server/electron_build_config.js内
生产环境下的配置位于 生成的打包目录/config.js内

persagy_electron程序和persagy_electron程序通信、普通网页和persagy_electron程序通信说明

被调用方

声明供调用方进行远程调用的方法 
	声明方式:electron_render.electron_controll_fn_stat(fn);
	传入的fn可以是页面上存在的任意一个方法,此处以公司现用的框架来举例,假设供远程调用的方法为test,示例如下:
	export default {
		name:'',
		data(){
			return {
				myName:'测试控制的名称'
			};
		},
		methods:{
			test:function(x,y){
				console.log('我是:'+this.myName+',我要控制的x为:'+x+'我要控制的y为:'+y);
			}
		},
		mounted:function(){
			var _this=this;
			Vue.nextTick(function () {
				electron_render.electron_controll_fn_stat(_this.test);
			});
		}
	}

调用方

以任意的形式或第三方库发送http请求到被调用方
	此处以公司现用的前端框架来举例说明,且假设要调用的方法为上述被调用方里的test,代码如下:
		1.在persagy_config.js里增加
			'/api/electron_comm': {
				target: 'http://192.168.0.48:8088',
				pathRewrite: { '^/api/': '/' }
			}
			
			说明:
				electron_comm固定,api可以不写
				target里的ip地址为被调用方的ip地址,端口号为被调用方监听的端口号
		2.在需要调用远程方法的地方发送请求
			axios.request({
			  url: "/api/electron_comm/3DMODEL/test",
			  method: "post",
			  data: [0, 1]
			})
			.then((res) => {})
			.catch((err) => {});
			
			说明:
				url中的/api/electron_comm为persagy_config.js里的配置,3DMODEL是指令类型(见下述操作指令类型说明),test为要调用的远程控制方法名称
				data固定为数组类型,数组顺序、长度要和调用的远程控制方法的参数保持一致;此例中对应test方法的参数,第一项对应参数x,第二项对应参数y。
				收到返回 {r:1} 代表调用成功了

操作指令类型说明

3DMODEL		3D模型之间进行远程通信控制