Giter VIP home page Giter VIP logo

windows-native-registry's Introduction

windows-native-registry

Node CI

  • No external processes.
  • Node-API
  • Electron ready
export interface RegistryValue {
    name: string
    type: REG
    value: any
}

export enum HK {
    CR = 0x80000000,
    CU = 0x80000001,
    LM = 0x80000002,
    U = 0x80000003,
}

export enum REG {
    SZ = 1,
    EXPAND_SZ = 2,
    BINARY = 3,
    DWORD = 4,
}

export function getRegistryKey (root: HK, path: string): {[name: string]: RegistryValue}

export function getRegistryValue (root: HK, path: string, name: string): any

export function setRegistryValue (root: HK, path: string, name: string, type: REG, value: string): any

export function setRegistryValue (root: HK, path: string, name: string, type: REG.MULTI_SZ, value: string[]): any

export function listRegistrySubkeys (root: HK, path: string): string[]

export function createRegistryKey (root: HK, path: string)

export function deleteRegistryKey (root: HK, path: string)

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Christian Walther

πŸ’»

AndrΓ© Sikma

πŸ’»

This project follows the all-contributors specification. Contributions of any kind welcome!

windows-native-registry's People

Contributors

allcontributors[bot] avatar cwalther avatar dependabot-preview[bot] avatar dependabot[bot] avatar eugeny avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

windows-native-registry's Issues

License

Hi! πŸ‘‹

I found your module, it seems to be well-built and tiny, thanks for making it!
Could you please add a license to the repository?

I see that package.json says it's MIT, but it would be good to have it in the repo too.

Thank you for your effort! πŸ™

A cross-platform project fails to install a package on a non-Windows OS.

Hello, thank you for providing your wonderful module.

I am facing one problem in applying this module to my solution.

I am developing a cross-platform app and I am designing my code to get the registry through this module only when it detects that it is a Windows OS.

However, when I run npm install on other OS (e.g. macOS), I get the following error:

npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for [email protected]: wanted {"os":"win32"} (current: {"os":"darwin"})
npm ERR! notsup Valid os:  win32
npm ERR! notsup Actual os: darwin

npm ERR! A complete log of this run can be found in: /path/to/log

I know that this module only works on Windows, but I want to keep the module installed in situations where I'm forced to include it and want to branch based on the OS.

I also tried cloning this repository and removing the following from the package.json.

// package.json


"os": [
   "win32"
  ],

However, on macOS, building with npm i seems to fail.

Could you please consider this? Thanks again!

Regards,

tsc report errors TS7034, TS7005, TS2322 and TS7053

I used yarn add windows-native-registry to add this package into my project, and then use it.
But when I ran the tsc to compile the project, I got the errors even if I added the "node_modules" to tsconfig to ignore it.

Ξ» tsc
node_modules/windows-native-registry/index.ts:29:5 - error TS7034: Variable 'native' implicitly has type 'any' in some locations where its type cannot be determined.

29 let native
       ~~~~~~

node_modules/windows-native-registry/index.ts:31:10 - error TS7005: Variable 'native' implicitly has an 'any' type.

31     if (!native) {
            ~~~~~~

node_modules/windows-native-registry/index.ts:34:12 - error TS7005: Variable 'native' implicitly has an 'any' type.

34     return native
              ~~~~~~

node_modules/windows-native-registry/index.ts:41:9 - error TS2322: Type 'null' is not assignable to type '{ [name: string]: RegistryValue; }'.

41         return null
           ~~~~~~~~~~~

node_modules/windows-native-registry/index.ts:44:9 - error TS7053: Element implicitly has an 'any' type because expression of type 'any' can't be used to index type '{}'.

44         ret[value.name] = value
           ~~~~~~~~~~~~~~~


Found 5 errors in the same file, starting at: node_modules/windows-native-registry/index.ts:29

Could u please help to take a look at it?
thx.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.