electron-macos-file-provider
v1.0.12
Published
Apple FileProvider for macos using the N-API extension electron
Downloads
122
Maintainers
Readme
Electron Expand Apple FileProvider for MacOS
trying to implement Apple FileProvider for macos using the N-API extension electron.
Install Guide
- installation dependency
npm install electron-macos-file-provider
- copy the
PlugIns/EleFileProvider.appex
you have configured and compiled in your Electron application construction process. reference Developer document part configuration and compile EleFileProvider.appex
APIs
NSFileProviderManager addDomain
addDomain("cloud.lazycat.client", "",
{
url: "http://localhost:8080/webdav/",
user: "user001",
password: "mypassword",
},
(err: any) => {
if(err) {
console.log("[EleFileProvider] addDomain failed", err);
return;
}
console.log("[EleFileProvider] addDomain success!");
})
NSFileProviderManager removeAllDomains
removeAllDomains((err: any) => {
if(err) {
console.log("[EleFileProvider] removeAllDomains failed", err);
return;
}
console.log("[EleFileProvider] removeAllDomains success!");
})
NSFileProviderManager getUserVisibleURLForItemIdentifier
getUserVisiblePath("cloud.lazycat.client", "")
.then(path => {
// path = /Users/Apollo/Library/CloudStorage/MyAppClient
console.log("[EleFileProvider] getUserVisiblePath:", path)
})
.catch(error => {
console.error("[EleFileProvider] getUserVisiblePath failed", error)
})
Developer
Please use
xcode
to openEFPHelper.xcodeproj
and configure your development team and App Identifier and the correctapp groups identifier
.If you need to modify FileProvider Expand, you can try to run the
EFPHelper
application for debugging.
execute
npm install
installation dependencyconfigure node-gyp
npm run dev:init
build node native modules
npm run dev:build
build EleFileProvider PlugIns
npm run dev:plugin
Supports
- [x] WebDAV Storage
References
https://nodejs.org/api/n-api.html#node-api
https://github.com/nodejs/node-addon-examples
Contributing
This project exists thanks to all the people who contribute.
We welcome contributions of any kind, please see our contributing guide. Found a bug? Please submit an issue.
License
This Project is MIT licensed.