{"_id":"@142vip/copyright","_rev":"2-9b2a25fc72d28ae9d6f9389b2acf9be3","name":"@142vip/copyright","dist-tags":{"latest":"0.0.1-alpha.2"},"versions":{"0.0.1-alpha.1":{"name":"@142vip/copyright","version":"0.0.1-alpha.1","keywords":["公众号搜：储凡","142vip","@142vip","@142vip/copyright","软件著作","中国版权保护中心"],"author":{"name":"mmdapl","email":"mmdapl@163.com"},"license":"MIT","_id":"@142vip/copyright@0.0.1-alpha.1","maintainers":[{"name":"mmdapl","email":"2237221210@qq.com"}],"homepage":"https://142vip.github.io/core-x/packages/copyright/","bugs":{"url":"https://github.com/142vip/core-x/issues"},"dist":{"shasum":"48569c2fd78a3c1222f392c59cff818315eb64e4","tarball":"https://registry.npmjs.org/@142vip/copyright/-/copyright-0.0.1-alpha.1.tgz","fileCount":8,"integrity":"sha512-bBWbe7eKBIgyMdhBd9kwWOG0bhrYhksZp1kQGeRA2aeomnJRpVEv20VPKmzduLX2nKhNxY+y4w8nwl1hfo8Mzw==","signatures":[{"sig":"MEYCIQDoRq2qGVs5EkRr3NXucIkzMe6QCe+sTB4DG1JEadYiFAIhAOaMDvdBzEFitit7VqvtXUVqde92juPCZ17Y8uJ/27Jv","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":26103},"main":"./dist/index.mjs","_from":"file:142vip-copyright-0.0.1-alpha.1.tgz","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"}},"private":false,"scripts":{"build":"unbuild","typecheck":"tsc --noEmit"},"_npmUser":{"name":"mmdapl","email":"2237221210@qq.com"},"_resolved":"/tmp/7ae2ff5ed8a9b3e2b55f0e4fa43ec5de/142vip-copyright-0.0.1-alpha.1.tgz","_integrity":"sha512-bBWbe7eKBIgyMdhBd9kwWOG0bhrYhksZp1kQGeRA2aeomnJRpVEv20VPKmzduLX2nKhNxY+y4w8nwl1hfo8Mzw==","authorInfo":{"url":"https://github.com/142vip","name":"微信公众号：储凡","email":"fairy_vip@2925.com","homePage":"https://142vip.cn"},"repository":{"url":"git+https://github.com/142vip/core-x.git","type":"git","directory":"packages/copyright"},"_npmVersion":"10.5.0","description":"软著工具包，用于生成软著申请的文件材料","directories":{},"sideEffects":false,"_nodeVersion":"20.12.2","dependencies":{"docx":"9.2.0","@142vip/utils":"0.0.1-alpha.31"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/copyright_0.0.1-alpha.1_1744271911957_0.33848218642418404","host":"s3://npm-registry-packages-npm-production"}},"0.0.1-alpha.2":{"name":"@142vip/copyright","version":"0.0.1-alpha.2","private":false,"description":"软著工具包，用于生成软著申请的文件材料","author":{"name":"mmdapl","email":"mmdapl@163.com"},"license":"MIT","homepage":"https://142vip.github.io/core-x/packages/copyright/","repository":{"type":"git","url":"git+https://github.com/142vip/core-x.git","directory":"packages/copyright"},"keywords":["公众号搜：储凡","142vip","@142vip","@142vip/copyright","软著","软件著作","中国版权保护中心"],"sideEffects":false,"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"}},"main":"./dist/index.mjs","module":"./dist/index.mjs","types":"./dist/index.d.ts","authorInfo":{"name":"微信公众号：储凡","email":"fairy_vip@2925.com","url":"https://github.com/142vip","homePage":"https://142vip.cn"},"dependencies":{"docx":"9.3.0","@142vip/utils":"0.0.1-alpha.33"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"scripts":{"build":"unbuild","typecheck":"tsc --noEmit"},"bugs":{"url":"https://github.com/142vip/core-x/issues"},"_id":"@142vip/copyright@0.0.1-alpha.2","_integrity":"sha512-92er/n6bKUuOBGO+5UvlvO2CPnDkHzubqMkCL4ecfMbOEpcpd2hBCfntBUzptkEqhogqX0Q12fTx00Y/LfIF7A==","_resolved":"/tmp/c754c53fdf67a781e1e532f44881d1b9/142vip-copyright-0.0.1-alpha.2.tgz","_from":"file:142vip-copyright-0.0.1-alpha.2.tgz","_nodeVersion":"20.12.2","_npmVersion":"10.5.0","dist":{"integrity":"sha512-92er/n6bKUuOBGO+5UvlvO2CPnDkHzubqMkCL4ecfMbOEpcpd2hBCfntBUzptkEqhogqX0Q12fTx00Y/LfIF7A==","shasum":"61d7dcc41b40417e85ee25f5e0e2093e4285f3dc","tarball":"https://registry.npmjs.org/@142vip/copyright/-/copyright-0.0.1-alpha.2.tgz","fileCount":8,"unpackedSize":30500,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDaCWCBlfmQQp84pPmqwy7M5aaQcIsH5LdPnWROjl3JwwIgaIHu1TqYNIWTttwP4gZQAYUJUCUmww8kwvzVt5J/LEI="}]},"_npmUser":{"name":"mmdapl","email":"2237221210@qq.com"},"directories":{},"maintainers":[{"name":"mmdapl","email":"2237221210@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/copyright_0.0.1-alpha.2_1744716838938_0.2104888615165661"},"_hasShrinkwrap":false}},"time":{"created":"2025-04-10T07:58:31.870Z","modified":"2025-04-15T11:33:59.282Z","0.0.1-alpha.1":"2025-04-10T07:58:32.122Z","0.0.1-alpha.2":"2025-04-15T11:33:59.097Z"},"bugs":{"url":"https://github.com/142vip/core-x/issues"},"author":{"name":"mmdapl","email":"mmdapl@163.com"},"license":"MIT","homepage":"https://142vip.github.io/core-x/packages/copyright/","keywords":["公众号搜：储凡","142vip","@142vip","@142vip/copyright","软著","软件著作","中国版权保护中心"],"repository":{"type":"git","url":"git+https://github.com/142vip/core-x.git","directory":"packages/copyright"},"description":"软著工具包，用于生成软著申请的文件材料","maintainers":[{"name":"mmdapl","email":"2237221210@qq.com"}],"readme":"# @142vip/copyright\n\n[![NPM version](https://img.shields.io/npm/v/@142vip/copyright?labelColor=0b3d52&color=1da469&label=version)](https://www.npmjs.com/package/@142vip/copyright)\n\n软著工具包，用于申请软件著作权的前后30页连续源代码文档。\n\n## 安装\n\n```shell\n# 安装\npnpm i @142vip/copyright\n```\n\n## 使用\n\n### 快速生成\n\n```ts\nimport { VipCopyright } from '@142vip/copyright'\n\n// 静态方法\nawait VipCopyright.quickGenerateDocx({\n  copyrightTitle: 'AI大模型平台',\n  copyrightVersion: 'V1.0',\n  sourceCodeDir: './',\n  fileType: 'ts',\n})\n```\n\n### 标准用法\n```ts\nimport { VipCopyright } from '@142vip/copyright'\n\n// 实例化，创建对象\nconst vipCopyright = new VipCopyright(copyrightTitle, copyrightVersion, {\n  // 是否需要终端打印日志，默认false\n  logger: true,\n})\n\n// 生成源代码文档\nawait vipCopyright.generateDocx('./', 'ts')\n```\n\n## 支持的语言\n\n```ts\n/**\n * 软著支持的源代码文件类型\n */\nexport enum CopyrightFileType {\n  JAVA = 'java',\n  JAVASCRIPT = 'js',\n  TYPESCRIPT = 'ts',\n  PYTHON = 'py',\n  C = 'c',\n  CPP = 'cpp',\n  GO = 'go',\n  SWIFT = 'swift',\n  PHP = 'php',\n  RUST = 'rs',\n  SHELL = 'sh',\n  SQL = 'sql',\n  YAML = 'yaml',\n  YML = 'yml',\n  JSON = 'json',\n  XML = 'xml',\n  HTML = 'html',\n  TEXT = 'txt',\n}\n```\n\n## API\n\n- `VipCopyright`类\n  - 构造函数\n    - `copyrightTitle`: 版权标题\n    - `copyrightVersion`: 版权版本\n    - `options`: 选项\n  - 方法\n    - `quickGenerateDocx`: 快速生成源代码文档\n      - `options`: 选项\n    - `generateDocx`: 生成源代码文档\n      - `sourceCodeDir`: 源代码目录\n      - `fileType`: 文件类型\n      - `options`: 选项\n\n    - `saveCodeToDocx`: 保存源代码到文档\n      - `sourceCode`: 源代码\n      - `filePath`: 文件路径\n      - `fileType`: 文件类型\n      - `options`: 选项\n    - `scanSourceCode`: 扫描源代码\n      - `sourceCodeDir`: 源代码目录\n      - `fileType`: 文件类型\n      - `options`: 选项\n\n```ts\n/**\n * 版权对象实例化参数\n * - 可选\n */\nexport interface CopyrightOptions {\n  /**\n   * 每页最大行数\n   */\n  maxLineCountInPage?: number\n  /**\n   * 扫描的最大代码行数\n   */\n  maxScanSourceLineCount?: number\n  /**\n   * 是否开启控制台日志\n   */\n  logger?: boolean\n}\n```\n\n## 工具方法\n\n- `isSourceCodeLine`: 判断是否为源代码行\n- `readSourceCodeLinesByFile`: 读取源代码\n- `getSourceCodeFiles`: 获取源代码文件\n- `getPageSectionInDocx`: 获取文档页模板\n\n## 链接\n\n-\n- [中国版权保护中心](https://register.ccopyright.com.cn/login.html?linkBackUrl=https://register.ccopyright.com.cn/account.html)\n\n## 证书\n\n[MIT](https://opensource.org/license/MIT)\n\nCopyright (c) 2019-present, 142vip 储凡\n","readmeFilename":"README.md"}