{"id":14989044,"url":"https://github.com/lightapis/userscript-with-webdav","last_synced_at":"2026-02-25T13:07:06.518Z","repository":{"id":197914644,"uuid":"699751977","full_name":"LightAPIs/userscript-with-webdav","owner":"LightAPIs","description":"Connect WebDAV in the Tampermonkey/Violentmonkey script","archived":false,"fork":false,"pushed_at":"2024-12-01T11:25:54.000Z","size":49,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-08T15:41:38.602Z","etag":null,"topics":["tampermonkey","userscript","violentmonkey","webdav"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/userscript-with-webdav","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LightAPIs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-10-03T09:11:54.000Z","updated_at":"2024-12-01T11:25:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"c69996f5-9a38-4c71-b4e5-c1b027b09ae8","html_url":"https://github.com/LightAPIs/userscript-with-webdav","commit_stats":{"total_commits":3,"total_committers":1,"mean_commits":3.0,"dds":0.0,"last_synced_commit":"acad9631eee9726dead47665c91534eb39b095f7"},"previous_names":["lightapis/userscript-with-webdav"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/LightAPIs/userscript-with-webdav","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LightAPIs%2Fuserscript-with-webdav","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LightAPIs%2Fuserscript-with-webdav/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LightAPIs%2Fuserscript-with-webdav/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LightAPIs%2Fuserscript-with-webdav/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LightAPIs","download_url":"https://codeload.github.com/LightAPIs/userscript-with-webdav/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LightAPIs%2Fuserscript-with-webdav/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281527385,"owners_count":26516845,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-28T02:00:06.022Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["tampermonkey","userscript","violentmonkey","webdav"],"created_at":"2024-09-24T14:17:37.409Z","updated_at":"2025-10-28T22:49:18.864Z","avatar_url":"https://github.com/LightAPIs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# userscript-with-webdav\n\nConnect WebDAV in the Tampermonkey/Violentmonkey script.\n\n## Installation\n\nin userscript:\n\n```jsvascript\n// @require  https://cdn.jsdelivr.net/npm/userscript-with-webdav@latest/index.iife.js\n// @grant    GM_xmlhttpRequest\n// @connect  *\n```\n\nor embed:\n\n```shell\nnpm install userscript-with-webdav\n```\n\n## Usage\n\nExample:\n\n```typescript\n// When embed:\nimport Webdav from 'userscript-with-webdav';\n\n(async () =\u003e {\n  const wh = new Webdav('\u003cwebDAVURL\u003e', '\u003cwebDAVUser\u003e', '\u003cwebDAVPassword\u003e');\n\n  // download\n  try {\n    const res = await wh.download('path/to/your/file');\n    console.log('status:', res.status);\n    console.log('data:', res.data);\n  } catch (err) {\n    if (err instanceof Webdav.NotFound) {\n      console.error('file does not exist');\n    } else if (err instanceof Webdav.Unauthorized) {\n      console.error('authentication failed');\n    }\n  }\n\n  // upload\n  try {\n    await wh.upload('path/to/your/file', '\u003cdata\u003e');\n  } catch (err) {\n    if (err instanceof Webdav.Forbidden) {\n      console.error('permission error');\n    }\n  }\n})();\n```\n\n## Type\n\n```typescript\ndeclare class Webdav {\n  static InternalError: typeof InternalError;\n  static Unauthorized: typeof Unauthorized;\n  static Forbidden: typeof Forbidden;\n  static NotFound: typeof NotFound;\n  static Redirection: typeof Redirection;\n  static ClientSideError: typeof ClientSideError;\n  static ServerSideError: typeof ServerSideError;\n  /**\n   * Constructor\n   * @param domainURL WebDAV domain\n   * @param user User name\n   * @param password User password\n   */\n  constructor(domainURL?: string, user?: string, password?: string);\n  /**\n   * Generate validation request header\n   * @returns Verification request header\n   */\n  updateConfig(domainURL: string, user: string, password: string): void;\n  /**\n   * Download file content\n   * @param fileURL Relative file URL\n   * @returns Response\n   */\n  download(fileURL: string): Promise\u003cConnectionResponse\u003e;\n  /**\n   * Upload file content\n   * @param fileURL Relative file URL\n   * @param data Data\n   * @returns Response\n   */\n  upload(fileURL: string, data: string): Promise\u003cConnectionResponse\u003e;\n}\n\ndeclare interface ConnectionResponse {\n    /** Response status code */\n    status: number;\n    /** Response data */\n    data: string;\n}\n```\n\n## License\n\n[MIT](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flightapis%2Fuserscript-with-webdav","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flightapis%2Fuserscript-with-webdav","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flightapis%2Fuserscript-with-webdav/lists"}