{"name":"ts-morph","version":"2.0.1-rc","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 && echo \"Run: 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)\"","test-debug":"cross-env TS_NODE_COMPILER=\"ttypescript\" TS_NODE_TRANSPILE_ONLY=\"true\" mocha --opts mocha.opts --grep \"^(?!.*@performance)\" --inspect-brk","test-watch":"npm test -- --watch-extensions ts --watch","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)\"","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 ensure-mixin-not-applied-multiple-times validate-public-api-class-member-names validate-compiler-node-to-wrapped-type validate-code-fences","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.3.0","fs-extra":"^7.0.0","glob-parent":"^3.1.0","globby":"^8.0.1","is-negated-glob":"^1.0.0","multimatch":"^2.1.0","typescript":"^3.0.1"},"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":"^1.0.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-morph":"1.3.3","ts-nameof":"^3.0.3","ts-node":"7.0.0","tslint":"^5.11.0","ttypescript":"1.5.5","typescript":"3.4.3","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.3":"npm:typescript@3.3.3","typescript-3.4.3":"npm:typescript@3.4.3"},"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":"1a07283e9b4d0f0da77d1fa45c669bb2272c9d07","readme":"﻿ts-morph\r\n========\r\n\r\n[![npm version](https://badge.fury.io/js/ts-morph.svg)](https://badge.fury.io/js/ts-morph)\r\n[![Build Status](https://travis-ci.org/dsherret/ts-morph.svg?branch=master)](https://travis-ci.org/dsherret/ts-morph)\r\n[![Coverage Status](https://coveralls.io/repos/dsherret/ts-morph/badge.svg?branch=master&service=github)](https://coveralls.io/github/dsherret/ts-morph?branch=master)\r\n[![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)\r\n\r\n[TypeScript](https://github.com/Microsoft/TypeScript) Compiler API wrapper. Provides a simple way to navigate and manipulate TypeScript and JavaScript code.\r\n\r\nFormerly `ts-simple-ast`.\r\n\r\n## Library Development - Progress Update (02 February 2019)\r\n\r\nThe library has been renamed from `ts-simple-ast` to `ts-morph`. The version was also reset back to 1.0.0 with this change.\r\n\r\nView information on breaking changes in [breaking-changes.md](breaking-changes.md).\r\n\r\nThis library is still under early active development. Most common code manipulation/generation use cases are implemented, but there's still a lot of work to do.\r\n\r\nPlease open an issue if you find a feature missing or bug that isn't in the issue tracker.\r\n\r\n### Report\r\n\r\nView a generated report on what nodes have been wrapped in the [wrapped-nodes.md](wrapped-nodes.md) file.\r\n\r\n## Documentation\r\n\r\nWork in progress: https://dsherret.github.io/ts-morph/\r\n\r\n## Getting Started\r\n\r\n1. [Installing](https://dsherret.github.io/ts-morph/)\r\n2. [Instantiating](https://dsherret.github.io/ts-morph/setup/)\r\n3. [Adding source files](https://dsherret.github.io/ts-morph/setup/adding-source-files)\r\n4. [Getting source files](https://dsherret.github.io/ts-morph/navigation/getting-source-files)\r\n5. [Navigating](https://dsherret.github.io/ts-morph/navigation/example)\r\n6. [Manipulating](https://dsherret.github.io/ts-morph/manipulation/)\r\n\r\n## Example\r\n\r\n```ts\r\nimport { Project, StructureKind } from \"ts-morph\";\r\n\r\n// initialize\r\nconst project = new Project({\r\n    // Optionally specify compiler options, tsconfig.json, virtual file system, and more here.\r\n    // If you initialize with a tsconfig.json, then it will automatically populate the project\r\n    // with the associated source files.\r\n    // Read more: https://dsherret.github.io/ts-morph/setup/\r\n});\r\n\r\n// add source files\r\nproject.addExistingSourceFiles(\"src/**/*.ts\");\r\nconst myClassFile = project.createSourceFile(\"src/MyClass.ts\", \"export class MyClass {}\");\r\nconst myEnumFile = project.createSourceFile(\"src/MyEnum.ts\", {\r\n    statements: [{\r\n        kind: StructureKind.Enum,\r\n        name: \"MyEnum\",\r\n        isExported: true,\r\n        members: [{ name: \"member\" }]\r\n    }]\r\n});\r\n\r\n// get information from ast\r\nconst myClass = myClassFile.getClassOrThrow(\"MyClass\");\r\nmyClass.getName();          // returns: \"MyClass\"\r\nmyClass.hasExportKeyword(); // returns: true\r\nmyClass.isDefaultExport();  // returns: false\r\n\r\n// manipulate ast\r\nconst myInterface = myClassFile.addInterface({\r\n    name: \"IMyInterface\",\r\n    isExported: true,\r\n    properties: [{\r\n        name: \"myProp\",\r\n        type: \"number\"\r\n    }]\r\n});\r\n\r\nmyClass.rename(\"NewName\");\r\nmyClass.addImplements(myInterface.getName());\r\nmyClass.addProperty({\r\n    name: \"myProp\",\r\n    initializer: \"5\"\r\n});\r\n\r\nproject.getSourceFileOrThrow(\"src/ExistingFile.ts\").delete();\r\n\r\n// asynchronously save all the changes above\r\nproject.save();\r\n\r\n// get underlying compiler node from the typescript AST from any node\r\nconst compilerNode = myClassFile.compilerNode;\r\n```\r\n\r\nOr navigate existing compiler nodes created with the TypeScript compiler (the `ts` named export is the TypeScript compiler):\r\n\r\n```ts ignore-error: 1109\r\nimport { createWrappedNode, ClassDeclaration, ts } from \"ts-morph\";\r\n\r\n// some code that creates a class declaration using the ts object\r\nconst classNode: ts.ClassDeclaration = ...;\r\n\r\n// create and use a wrapped node\r\nconst classDec = createWrappedNode(classNode) as ClassDeclaration;\r\nconst firstProperty = classDec.getProperties()[0];\r\n\r\n// ... do more stuff here ...\r\n```\r\n\r\n## Resources\r\n\r\n* [AST Viewers](https://dsherret.github.io/ts-morph/setup/ast-viewers)\r\n","readmeFilename":"readme.md","_id":"ts-morph@2.0.1-rc","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"dsherret","email":"dsherret@gmail.com"},"dist":{"integrity":"sha512-b7NkFwpXzIqpOMouaKRuK8A4tjlPeAJ+OBY2/COnGBs7P4Jfr5F+MaxVldoB+jBNwrjFXBfx3Up45p1Fk1YNMw==","shasum":"2922e2a8f415a986d600342f2dd17168f7506f78","tarball":"http://registry-npm.ywwl.com/ts-morph/download/ts-morph-2.0.1-rc.tgz","fileCount":545,"unpackedSize":1721650,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcr+dTCRA9TVsSAnZWagAANK0P/20SOBxK8ul/5ZcbviZA\naKiohhahTz8GJZTiyhdh/K3dVc8wT7cFVN+KyZqCCtFItO08p8SoMPaTi3pb\nvLzU0lJOcAVKzmsYY3I+YPO4Jb1veSfS/MLC8nprelmVHNtUg9S78isbLYvT\nOZ22b9KNoCI54MwKormt2UQOcKWLqhDcelyD0fFQZJCYNrQR87k+R7btDJsr\nBfly/8WrP954RD8VhQHSIeXeo79iUOcni/O9o9kKT7K6o2/twVeNWHjufyw/\nHwu7x3Tec6iNoWhr+GorjcJqsHfRsRy6hQ/Libeof6ADEr5uu+quDfd4gr9L\nJJhS8qoKa1dUB43JXg5KqQT8iQJ+t1uhMS2BKe94ET578MP/EhGA9k6Kpj6X\n5mqrRQ036gVx8+UZxyrAe3iCrnwFgY1LanUIMuUDttDl206P9pQh8AhKQkoz\nnZO7jtZT3qDVdsjHvHxx1j59C5JhdJeumozKwH9dac6NI8YjV3ChUv6mSC6q\nFbbYdk3wH2GVEtGwWoRtrKcc4yWf8cpZpYvQg8ZlSgvbhem3lhHMReSg6N3B\nt3rL05yIXKSs6Iy9aJYrcxIaYRYRrK1bXL04srqa+ylAKgXI08J+UFvaFmP1\nNkGKBrB1I1mkpoIQKdOv+KnLIIvXHJeDSQile05K3+PsC/unWouhwnbbzjIi\nkXKg\r\n=7c04\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCXjzqZV/1l0fvU7wpIZ/F8j7xvFRogWFdEzYqDNdQyQgIgabCz0CSNaUiG+vwMjkpz2DfNOgW9CUIIG/mZwLo1oIo="}],"size":262166,"noattachment":false,"key":"/ts-morph/-/ts-morph-2.0.1-rc.tgz"},"maintainers":[{"name":"dsherret","email":"dsherret@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-morph_2.0.1-rc_1555031890240_0.15049198346084047"},"_hasShrinkwrap":false,"publish_time":1555031890516,"_cnpm_publish_time":1555031890516,"dist-tags":{"latest":"28.0.0","rc":"2.0.4-rc"}}