{"name":"ts-morph","version":"1.3.2","description":"TypeScript compiler wrapper for static analysis and code manipulation.","main":"dist/main.js","typings":"dist-declarations/ts-morph.d.ts","scripts":{"dopublish":"yarn run type-check-docs && yarn run package && yarn run publish-code-verification && npm publish --otp","lint":"yarn run lint-src && yarn run lint-scripts","lint-src":"tslint \"src/**/*.ts\"","lint-scripts":"tslint \"scripts/**/*.ts\"","lint-src-and-fix":"tslint \"src/**/*.ts\" --fix","build":"rimraf dist && npx ttsc && ts-node --transpileOnly scripts/build/removeEmptyFiles","build-declarations":"rimraf dist-declarations && ts-node --max-old-space-size=8192 --transpileOnly scripts/generation/main create-code-block-writer-file create-declaration-file","test":"cross-env TS_NODE_COMPILER=\"ttypescript\" TS_NODE_TRANSPILE_ONLY=\"true\" mocha --opts mocha.opts --grep @performance --invert","test-debug":"cross-env TS_NODE_COMPILER=\"ttypescript\" TS_NODE_TRANSPILE_ONLY=\"true\" mocha --opts mocha.opts --grep @performance --invert --inspect-brk","test-ts-versions":"ts-node --transpileOnly scripts/test/testTypeScriptVersions","test-coverage":"cross-env TS_NODE_COMPILER=\"ttypescript\" TS_NODE_TRANSPILE_ONLY=\"true\" nyc --reporter=lcov mocha --opts mocha.opts --grep @performance --invert","test-performance":"cross-env TS_NODE_COMPILER=\"ttypescript\" TS_NODE_TRANSPILE_ONLY=\"true\" mocha --opts mocha.opts --grep @performance --reporter spec","type-check-library":"ts-node --transpileOnly scripts/typeCheckLibrary","code-generate":"ts-node --transpileOnly --compiler ttypescript scripts/generation/main","refactor":"ts-node --transpileOnly scripts/refactor","output-wrapped-nodes":"ts-node --transpileOnly scripts/generation/outputWrappedNodesInfo","package":"yarn run build && yarn run build-declarations","publish-code-verification":"yarn run code-verification && yarn run ensure-no-declaration-file-errors && yarn run ensure-declaration-files-not-changed","code-verification":"ts-node --transpileOnly scripts/verification/main ensure-structures-match-classes ensure-overload-structures-match ensure-array-inputs-readonly ensure-classes-implement-structure-methods validate-public-api-class-member-names validate-compiler-node-to-wrapped-type","ensure-structures-match-classes":"ts-node --transpileOnly scripts/verification/main ensure-structures-match-classes","ensure-overload-structures-match":"ts-node --transpileOnly scripts/verification/main ensure-overload-structures-match","ensure-no-project-compile-errors":"ts-node --transpileOnly scripts/verification/ensureNoProjectCompileErrors","ensure-no-declaration-file-errors":"ts-node --transpileOnly scripts/verification/ensureNoDeclarationFileErrors","ensure-declaration-files-not-changed":"ts-node --transpileOnly scripts/verification/ensureDeclarationFilesNotChanged","ensure-array-inputs-readonly":"ts-node --transpileOnly scripts/verification/main ensure-array-inputs-readonly","ensure-or-throw-exists":"ts-node --transpileOnly scripts/verification/main ensure-or-throw-exists","overwrite-declaration-files":"yarn run build-declarations && shx cp -rf dist-declarations/ts-morph.d.ts lib/ts-morph.d.ts && shx cp -rf dist-declarations/code-block-writer.d.ts lib/code-block-writer.d.ts","type-check-docs":"ts-node --transpileOnly scripts/typeCheckDocumentation.ts","maintain-barrels":"barrel-maintainer src"},"repository":{"type":"git","url":"git+https://github.com/dsherret/ts-morph.git"},"keywords":["typescript","ast","static analysis","code generation","code refactor"],"author":{"name":"David Sherret"},"license":"MIT","bugs":{"url":"https://github.com/dsherret/ts-morph/issues"},"homepage":"https://github.com/dsherret/ts-morph#readme","nyc":{"extension":[".ts",".tsx"],"include":["src/**/*.ts","!src/tests/**/*.ts","!src/utils/TypeGuards.ts"],"reporter":["html"],"all":true},"typescript":{"definition":"dist-declarations/ts-morph.d.ts"},"dependencies":{"@dsherret/to-absolute-glob":"^2.0.2","code-block-writer":"7.2.2","fs-extra":"^7.0.0","glob-parent":"^3.1.0","globby":"^8.0.1","is-negated-glob":"^1.0.0","multimatch":"^2.1.0","tslib":"^1.9.0","typescript":">=3.0.1 <3.4.0"},"devDependencies":{"@types/chai":"^4.1.2","@types/diff":"^3.5.1","@types/fs-extra":"^5.0.2","@types/glob-parent":"^3.1.0","@types/is-negated-glob":"^1.0.0","@types/mocha":"^5.2.0","@types/multimatch":"^2.1.2","@types/node":"^6.0.110","@types/ts-nameof":"^2.0.0","barrel-maintainer":"^1.4.0","chai":"^4.1.2","chalk":"^2.4.0","conditional-type-checks":"^0.5.0","coveralls":"^3.0.1","cross-env":"^5.1.4","diff":"^3.5.0","mocha":"5.2.0","npx":"^10.2.0","nyc":"12.0.2","rimraf":"^2.6.2","shelljs":"^0.8.2","shx":"^0.3.2","source-map-support":"^0.5.5","ts-nameof":"^3.0.0","ts-node":"7.0.0","ts-morph":"1.0.0","tslint":"^5.11.0","ttypescript":"1.5.5","typescript-3.0.1":"npm:typescript@3.0.1","typescript-3.0.3":"npm:typescript@3.0.3","typescript-3.1.6":"npm:typescript@3.1.6","typescript-3.2.4":"npm:typescript@3.2.4","typescript-3.3.1":"npm:typescript@3.3.1"},"standard-version":{"tagPrefix":""},"browser":{"fs":false,"os":false,"fs.realpath":false,"fs-extra":false,"dir-glob":false,"graceful-fs":false,"fast-glob":false,"source-map-support":false,"globby":false,"glob-parent":false,"glob":false},"gitHead":"4cc651f4923e674b1be1da35ac6ab1e534126a95","_id":"ts-morph@1.3.2","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"dsherret","email":"dsherret@gmail.com"},"dist":{"integrity":"sha512-NaPUD0NY1nfRfdWnGaYMFsIAcQyuS0teCOjZ+v5nvBYziuKZaJ7z5JLkHkhrBkffqR9DLnn2Zx1vdW5Ub1doxg==","shasum":"7cca879159291a031db6ca7a06c39c36a97307f0","tarball":"http://registry-npm.ywwl.com/ts-morph/download/ts-morph-1.3.2.tgz","fileCount":531,"unpackedSize":1980002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcn5nSCRA9TVsSAnZWagAAeWgQAISDk9k9aQ8VQr161Yqu\nA4jzxEx201gXkBHxLEs1FuOKETDwcpm3N9UzdiFgGr+BC1/tqFhi6ocRKK7+\nGZLEYR+Oo21os2tX7n2AQDHnYvo3enzb2rs+D9w3zzDHvqIPiGz1gs72QR6O\n1Uc7bO6Ga66F2G5CEXN1BDb1EN9TRfI5NWI1OBx1GzGPwJgqBfBcuTMsqWeq\nmw4p8mNfXmnyoln3PnhNTABs8JhKyf2kjR1T6N32ux1sMAqiXDqTDN2FFQN/\nTy9qU4Neueidx4hfmOm6NxK4OZxB1xvbT09ruHVd7seb7Y+s0ZtE/Ft2OiJB\nDeBqZShWoXzBEBzKMGhar5vrLcD4S8TspyhJ4h3BvqIN/7ZNSODp6FIG9Gp6\n/7fd8ZGNqsbW8oyU0pNtRlGrO1RlkYI2t6gVWkD2sYjF6uMCT8TDJYoRhBPJ\nzn2zY0/wjGnfric/HFULUyFqaC72yBCyNYT4wGhC4dR6K+ewyhk49LAsO4gq\nD0AH33uRkM0Fdstmg5HLvA51/B8o01UZ9y+uPcOHUqy0oeCUDtNbfAWv8znD\njeETyoH/9BzNlhbaZMG/z+Xzfox5ahoVH11DGBtNNnXBNds8vE4uIeSRkMVQ\n8wO1hZaAmaLgcF5mJaPhrY+PVHpnPqavgaEWQ6OEncvO2SG4LPEJeIfPdJN0\nxNN/\r\n=Npmm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCtK3MlSMj+HE6xp4CUOFG8S8XMa342jgwktCiS3Dn8HwIgBexkbQJZ9yCqgXEVSvlG7rnxMN1jY1oZ+tzF9iK/Zfs="}],"size":278604,"noattachment":false,"key":"/ts-morph/-/ts-morph-1.3.2.tgz"},"maintainers":[{"name":"dsherret","email":"dsherret@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-morph_1.3.2_1553963473483_0.7906829383284681"},"_hasShrinkwrap":false,"readme":"﻿# ts-morph\n\n[![npm version](https://badge.fury.io/js/ts-morph.svg)](https://badge.fury.io/js/ts-morph)\n[![CI](https://github.com/dsherret/ts-morph/workflows/CI/badge.svg)](https://github.com/dsherret/ts-morph/actions?query=workflow%3ACI)\n[![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)\n\n[TypeScript](https://github.com/Microsoft/TypeScript) Compiler API wrapper. Provides an easier way to programmatically navigate and manipulate TypeScript and JavaScript code.\n\nFormerly `ts-simple-ast`.\n\n## Overview\n\n- [Documentation](https://ts-morph.com/)\n- [Declaration file](https://github.com/dsherret/ts-morph/blob/latest/packages/ts-morph/lib/ts-morph.d.ts)\n\n## Main Features\n\n1. Wraps the compiler API objects to provide helper methods for getting information and programmatically changing files.\n2. Allows falling back to the compiler API objects if necessary (ex. `classDeclaration.compilerNode` or `typeChecker.compilerObject`).\n3. All changes are kept in memory (including file and directory moves) until specifying to save to the underlying file system.\n4. Changes are made to the text and wrapped nodes can be held on to between manipulations.\n\n## Getting Started\n\n1. [Installing](https://ts-morph.com/)\n2. [Instantiating](https://ts-morph.com/setup/)\n3. [Adding source files](https://ts-morph.com/setup/adding-source-files)\n4. [Getting source files](https://ts-morph.com/navigation/getting-source-files)\n5. [Navigating](https://ts-morph.com/navigation/example)\n6. [Manipulating](https://ts-morph.com/manipulation/)\n\n## Library Progress\n\nThis library is still under active development. Most common code manipulation/generation use cases are implemented, but there's still a lot of work to do. Please open an issue if you find a feature missing, bug, or question that isn't in the issue tracker.\n\n- [Breaking changes](https://github.com/dsherret/ts-morph/blob/latest/packages/ts-morph/breaking-changes.md)\n- [Change log](https://github.com/dsherret/ts-morph/blob/latest/packages/ts-morph/CHANGELOG.md)\n- [Wrapped nodes progress report](https://github.com/dsherret/ts-morph/blob/latest/packages/ts-morph/wrapped-nodes.md)\n\n## Example\n\n<!-- dprint-ignore -->\n```ts\nimport { Project, StructureKind } from \"ts-morph\";\n\n// initialize\nconst project = new Project({\n    // Optionally specify compiler options, tsconfig.json, in-memory file system, and more here.\n    // If you initialize with a tsconfig.json, then it will automatically populate the project\n    // with the associated source files.\n    // Read more: https://ts-morph.com/setup/\n});\n\n// add source files\nproject.addSourceFilesAtPaths(\"src/**/*.ts\");\nconst myClassFile = project.createSourceFile(\"src/MyClass.ts\", \"export class MyClass {}\");\nconst myEnumFile = project.createSourceFile(\"src/MyEnum.ts\", {\n    statements: [{\n        kind: StructureKind.Enum,\n        name: \"MyEnum\",\n        isExported: true,\n        members: [{ name: \"member\" }],\n    }],\n});\n\n// get information\nconst myClass = myClassFile.getClassOrThrow(\"MyClass\");\nmyClass.getName();          // returns: \"MyClass\"\nmyClass.hasExportKeyword(); // returns: true\nmyClass.isDefaultExport();  // returns: false\n\n// manipulate\nconst myInterface = myClassFile.addInterface({\n    name: \"IMyInterface\",\n    isExported: true,\n    properties: [{\n        name: \"myProp\",\n        type: \"number\",\n    }],\n});\n\nmyClass.rename(\"NewName\");\nmyClass.addImplements(myInterface.getName());\nmyClass.addProperty({\n    name: \"myProp\",\n    initializer: \"5\",\n});\n\nproject.getSourceFileOrThrow(\"src/ExistingFile.ts\").delete();\n\n// asynchronously save all the changes above\nawait project.save();\n\n// get underlying compiler node from the typescript AST from any node\nconst compilerNode = myClassFile.compilerNode;\n```\n\nOr navigate existing compiler nodes created with the TypeScript compiler (the `ts` named export is the TypeScript compiler):\n\n```ts ignore-error: 1109\nimport { createWrappedNode, ClassDeclaration, ts } from \"ts-morph\";\n\n// some code that creates a class declaration using the ts object\nconst classNode: ts.ClassDeclaration = ...;\n\n// create and use a wrapped node\nconst classDec = createWrappedNode(classNode) as ClassDeclaration;\nconst firstProperty = classDec.getProperties()[0];\n\n// ... do more stuff here ...\n```\n","publish_time":1553963473826,"_cnpm_publish_time":1553963473826,"dist-tags":{"latest":"28.0.0","rc":"2.0.4-rc"}}