Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
tec27 committed Jan 16, 2024
0 parents commit bc48d0b
Show file tree
Hide file tree
Showing 11 changed files with 338 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.bat]
end_of_line = crlf

[*.rs]
indent_size = 4
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
native/target
native/index.node
prebuilds/
**/node_modules
**/.DS_Store
.idea
npm-debug.log*
6 changes: 6 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
native/target
native/index.node
**/*~
.github
.vscode
.idea
10 changes: 10 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"arrowParens": "avoid",
"bracketSameLine": true,
"endOfLine": "lf",
"jsxSingleQuote": true,
"printWidth": 100,
"semi": false,
"singleQuote": true,
"trailingComma": "all"
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2024 Travis Collins

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# @shieldbattery/windows-registry

A Rust/neon-based node.js native module for accessing and modifying the Windows Registry.

## OS Support

Currently we only publish builds for x64, and require Windows 10+.

## License

MIT
163 changes: 163 additions & 0 deletions native/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions native/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[package]
name = "native"
version = "0.1.0"
description = "A Rust/neon-based node.js native module for accessing and modifying the Windows registry."
license = "MIT"
edition = "2021"
exclude = ["index.node"]

[lib]
crate-type = ["cdylib"]

[dependencies]
anyhow = "1.0"

[dependencies.neon]
version = "0.10"
default-features = false
features = ["napi-6", "promise-api", "channel-api"]
11 changes: 11 additions & 0 deletions native/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
use neon::prelude::*;

fn hello(mut cx: FunctionContext) -> JsResult<JsString> {
Ok(cx.string("hello node"))
}

#[neon::main]
fn main(mut cx: ModuleContext) -> NeonResult<()> {
cx.export_function("hello", hello)?;
Ok(())
}
31 changes: 31 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "windows-registry",
"version": "1.0.0",
"description": "A Rust/neon-based node.js native module for accessing and modifying the Windows registry.",
"main": "index.js",
"scripts": {
"build": "cd native && cargo-cp-artifact -nc index.node -- cargo build --target=x86_64-pc-windows-msvc --message-format=json-render-diagnostics",
"build-debug": "npm run build --",
"build-release": "npm run build -- --release",
"tag-prebuild": "node ./tag-prebuild.js",
"test": "cd native && cargo test"
},
"keywords": [
"windows",
"registry"
],
"author": "Travis Collins <[email protected]> (http://tec27.com)",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/ShieldBattery/windows-registry.git"
},
"bugs": {
"url": "https://github.com/ShieldBattery/windows-registry/issues"
},
"homepage": "https://github.com/ShieldBattery/windows-registry#readme",
"devDependencies": {
"cargo-cp-artifact": "^0.1.8",
"neon-tag-prebuild": "^1.1.1"
}
}
45 changes: 45 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bc48d0b

Please sign in to comment.