qiao-regedit

3.5.9 • Public • Published

qiao-regedit

npm version npm downloads

nodejs 操作 windows 注册表

install

安装

npm i qiao-regedit

use

使用

// cjs
const { addValue } = require('qiao-regedit');

// mjs
import { addValue } from 'qiao-regedit';

api

addValue

添加值

  • options.key
    • 类型: string
    • 说明: key
  • options.name
    • 类型: string
    • 说明: name
  • options.data
    • 类型: string
    • 说明: data
  • callback
    • 类型: function
    • 说明: 添加成功的回调函数
const options = {
  key: 'HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run',
  name: 'test',
  data: 'haha',
};

addValue(options, (res) => {
  console.log(res);
});

delValue

删除值

  • options.key
    • 类型: string
    • 说明: key
  • options.name
    • 类型: string
    • 说明: name
  • callback
    • 类型: function
    • 说明: 删除成功的回调函数
const options = {
  key: 'HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run',
  name: 'test',
};

delValue(options, (res) => {
  console.log(res);
});

listValues

列出值

  • key
    • 类型: string
    • 说明: key
  • callback
    • 类型: function
    • 说明: 列出成功的回调函数
const key = 'HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run';
listValues(key, (err, res) => {
  console.log(err, res);
});

Package Sidebar

Install

npm i qiao-regedit

Weekly Downloads

3

Version

3.5.9

License

MIT

Unpacked Size

8.59 kB

Total Files

6

Last publish

Collaborators

  • npm_insistime