{"name":"ts-morph","version":"2.0.4-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","test-debug":"cross-env TS_NODE_COMPILER=\"ttypescript\" TS_NODE_TRANSPILE_ONLY=\"true\" mocha --opts mocha.opts --inspect-brk","test-watch":"yarn run 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","test-performance":"yarn run build && node ./dist/tests/performance/run.js","test-performance-save":"yarn run test-performance --save","type-check-library":"ts-node --transpileOnly scripts/typeCheckLibrary","type-check-scripts":"tsc --noEmit --project tsconfig.scripts.json","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.1","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":"2.0.1-rc","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},"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","gitHead":"7c2b8ac60b36c6a8ddbab26cb21634807ad13b85","_id":"ts-morph@2.0.4-rc","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"dsherret","email":"dsherret@gmail.com"},"dist":{"integrity":"sha512-56QPhLUDxFDqvA7/XS8WvWxwGtciZgDFiaEbNNWlvZFLGiYJz8x+sTmDJ/dSjRRfnDNpvmRyuiWqU8NbJZ5z1g==","shasum":"bc0198eb96095ebd0255122af62a4e5bbb1d53b8","tarball":"http://registry-npm.ywwl.com/ts-morph/download/ts-morph-2.0.4-rc.tgz","fileCount":544,"unpackedSize":1721323,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJctQoBCRA9TVsSAnZWagAA48EP/2GVaa0j0rYkfz9Lj9Tf\nGqavAo2WQzXGwOwuSrXeJwSv6Y66Sfocn/CFwTgCGNPOaH/TS9mzKPTmkYM8\nA+COMk5M/XahhW9j6ZNEvvn9adoRK6SIpm9x3ZdxLGdSMs1f3ZhstjwE97al\n/qAxu3KWTSqoSSCn4K4Ehd2V6eG0TZfFFCFddgnuXAz4w+IoHpJMoVED+tgB\nOnjUTFCFqbE8tGqjRnlhCWtIwJqPpiaM3IlMpvvzQ43jVMczTmheDEAq0Sd+\nl5KCJ+VN7ilIU0Ge7dvE+8u/Rczhil56PiK7Esfvj+zXCuaHIN1h5P8+S/aP\nDE+N56dejvRTYEL/NEL/3bpsub7o+G6xuJaAN/MrqdDidA8j3j9xCxkU1yTc\nWSSmOi1jEadB8iMPxBsMzOYr66oj0/yPAY5NYb8wCRd1gsTuEwSke+KtmMPx\nhhbnl1R4+s7QqL8ILl7Mt/a0VWbyt6K3/WsXel5l/ji6HmKkq6uUB7W6z/dh\nbzWuWsBdAps61jiYZcRblVAMgU84lApHoOkzkFfxFd/Og80tbSPvjwpY48mq\nX+1fVI1RI0JBj6NlgdtrPA8KrG6Icg7/QRnsP+NB3dxnmeb6yT240HjvdaMQ\nRjwCsWr0nZ1fwV0lXydSQ6AAiMnV2oeRs/clyHHduA+n+Et8qAh/bGhD05M1\nEbR4\r\n=yeOq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDf7bWIuSnsC6m5t4CKdLPDgtcVZqTM7zHrTnt4ZvIolAiEA2pHZtbtd1fFLabaPJjtD+VjxubyZTBCJiI31dImUsdA="}],"size":261965,"noattachment":false,"key":"/ts-morph/-/ts-morph-2.0.4-rc.tgz"},"maintainers":[{"name":"dsherret","email":"dsherret@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-morph_2.0.4-rc_1555368448628_0.6474212462137405"},"_hasShrinkwrap":false,"publish_time":1555368448845,"_cnpm_publish_time":1555368448845,"dist-tags":{"latest":"28.0.0","rc":"2.0.4-rc"}}