Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@icreate/ics-chromely-plugin-core

Package Overview
Dependencies
Maintainers
4
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@icreate/ics-chromely-plugin-core

提供Ics Chromely Client核心本地操作插件js sdk,包含本地日志、主窗体控制、打开三方浏览器、打印机列表、硬件IP和Mac地址、本地配置获取和注册表读写等

  • 0.0.11
  • npm
  • Socket score

Version published
Weekly downloads
7
decreased by-12.5%
Maintainers
4
Weekly downloads
 
Created
Source

Usage

npm i @icreate/ics-chromely-plugin-core

feature

0.0.11 HardwareHelper增加获取操作系统描述GetOSDesc()
0.0.10 HardwareHelper增加获取操作系统描述GetOSDesc()

Features

  • LocalLogger:本地日志
  • BrowserHelper:浏览器帮助类
  • WindowHelper:主window帮助类
  • chromely:chromely对象
  • HardwareHelper:获取电脑Mac地址、Ip地址、主机名
  • PrinterHelper:打印机类
  • RegeditHelper:注册表类
  • ConfigHelper:本地配置类

Importing library

You can import the generated bundle to use the whole library generated by this starter:

import { LocalLogger, BrowserHelper, WindowHelper, Chromely, ConfigHelper } from '@icreate/ics-chromely-plugin-core'

LocalLogger

  // 日志级别
  level: LogLevels
  // 输出调试日志
  debug(logObject: any): Promise<String>
  // 输出普通日志
  info(logObject: any): Promise<String>
  // 输出警告日志
  warn(logObject: any): Promise<String>
  // 输出错误日志
  error(logObject: any): Promise<String>
  // 输出致命错误日志
  fatal(logObject: any): Promise<String>

BrowserHelper

  // 打开Google浏览器
  OpenChrome(url:string):void
  // 打开IE浏览器
  OpenIE(url:string):void
  // 打开FireFox浏览器
  OpenFireFox(url:string):void
  // 打开默认浏览器
  OpenDefault(url:string):void

WindowHelper

  // 主窗体最小化
  Minimize(): void
  // 主窗体最大化
  Maximize(): void
  // 主窗体还原
  Restore(): void
  // 主窗体关闭
  Close(): void
  // 重启程序
  Restart(): void
  // 主窗体状态
  State(): Promise<String>

Chromely

  // 是否处于非浏览器环境
  isChromely: boolean
  // 订阅C#事件
  $on(eventName: string, callback: Function): void
  // 取消订阅C#事件
  $off(eventName: string, callback: Function): void
  // 触发C#事件
  $emit(eventName: string): void

HardwareHelper

   // 获取本机Mac地址
  getMacAddress(): Promise<array>
  // 获取本机Ip地址
  getIpAddress(): Promise<array> 
  // 获取本机主机名
  getHostName(): Promise<string>
  // 获取操作系统描述
  GetOSDesc(): Promise<string>
  // 获取操作系统版本
  GetOsVersion(): Promise<string>  
  // 重启操作系统
  RestartOS(): void
  // 关闭操作系统
  CloseOS(): void

PrinterHelper

// 获取本地打印机列表
  getPrinterList(): Promise<array> 
  // 获取本地打印机列表
  getPrinterDefault(): Promise<string>
  // 判断指定打印机名称是否存在
  isPrinterExists(printerName: string): Promise<bool> 

RegeditHelper


  // 获取指定的注册表键对应的值
  getRegeditValue(name: string): Promise<string> 
  // 设置注册表键值
  setRegeditValue(name: string, value: string): Promise<string> 

ConfigHelper


  // 获取指定的配置键对应的值 多级可以使用:key1:key2:key3...
  Get(key: string): Promise<string>
  // 获取appsetting.json中的BaseUrl值
  GetBaseUrl(): Promise<string>

FAQs

Package last updated on 23 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc