{"name":"ts-morph","version":"7.0.3","description":"TypeScript compiler wrapper for static analysis and code manipulation.","main":"dist/ts-morph.js","typings":"lib/ts-morph.d.ts","scripts":{"dopublish":"yarn type-check-docs && yarn package && yarn publish-code-verification && echo \"Run: npm publish --otp\"","build":"rimraf dist && rollup --config && yarn build:declarations","build:declarations":"ts-node --transpile-only scripts/generation/main create-declaration-file","test":"cross-env TS_NODE_COMPILER=\"ttypescript\" TS_NODE_TRANSPILE_ONLY=\"true\" mocha","test:debug":"yarn test --inspect-brk","test:watch":"yarn test --watch-extensions ts --watch","test:ci":"yarn run test:coverage && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","test:ts-versions":"ts-node --transpile-only scripts/test/testTypeScriptVersions","test:coverage":"cross-env TS_NODE_COMPILER=\"ttypescript\" TS_NODE_TRANSPILE_ONLY=\"true\" nyc --reporter=lcov mocha","test:performance":"yarn build && node ./dist/tests/performance/run.js","test:performance-save":"yarn test:performance --save","type-check-library":"ts-node --transpile-only scripts/typeCheckLibrary","type-check-scripts":"tsc --noEmit --project scripts/tsconfig.json","code-generate":"ts-node --transpile-only --compiler ttypescript scripts/generation/main","refactor":"ts-node --transpile-only scripts/refactor","output-wrapped-nodes":"ts-node --transpile-only scripts/generation/outputWrappedNodesInfo","package":"yarn build","publish-code-verification":"yarn code-verification && yarn ensure-no-declaration-file-errors","code-verification":"ts-node --transpile-only 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 --transpile-only scripts/verification/main ensure-structures-match-classes","ensure-overload-structures-match":"ts-node --transpile-only scripts/verification/main ensure-overload-structures-match","ensure-no-project-compile-errors":"ts-node --transpile-only scripts/verification/ensureNoProjectCompileErrors","ensure-no-declaration-file-errors":"ts-node --transpile-only scripts/verification/ensureNoDeclarationFileErrors","ensure-array-inputs-readonly":"ts-node --transpile-only scripts/verification/main ensure-array-inputs-readonly","ensure-or-throw-exists":"ts-node --transpile-only scripts/verification/main ensure-or-throw-exists","type-check-docs":"ts-node --transpile-only scripts/typeCheckDocumentation.ts"},"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/structures/utils/forEachStructureChild.ts"],"reporter":["html"],"all":true},"dependencies":{"@dsherret/to-absolute-glob":"^2.0.2","@ts-morph/common":"~0.4.0","code-block-writer":"^10.1.0"},"devDependencies":{"@types/chai":"^4.2.11","@types/diff":"^4.0.2","@types/mocha":"^7.0.2","@types/node":"^13.11.0","@types/ts-nameof":"^4.2.1","@ts-morph/scripts":"~0.2.0","chai":"^4.2.0","conditional-type-checks":"^1.0.5","coveralls":"^3.0.11","cross-env":"^7.0.2","diff":"^4.0.2","mocha":"7.1.1","nyc":"15.0.1","rimraf":"^3.0.2","rollup":"^2.3.4","rollup-plugin-typescript2":"^0.27.0","shelljs":"^0.8.3","shx":"^0.3.2","ts-nameof":"^4.2.2","ts-node":"8.8.2","ttypescript":"1.5.10","typescript":"~3.8.3"},"standard-version":{"tagPrefix":"","skip":{"tag":true,"commit":true}},"browser":{"fs":false,"os":false,"fs.realpath":false,"fs-extra":false,"dir-glob":false,"graceful-fs":false,"fast-glob":false,"source-map-support":false,"glob-parent":false,"glob":false},"_id":"ts-morph@7.0.3","_nodeVersion":"12.16.0","_npmVersion":"6.14.2","dist":{"integrity":"sha512-IKvg8h5yQBubv7XQ8ku5exqgQbF7YgWm5/whaR1GV9+vaHOhn0zj7+A2/t0UNfNafH0Fxxz7m7ZK+QioYc1Dfg==","shasum":"039d7ec583f44767bc4b88765fb1a6c14de3b97d","tarball":"http://registry-npm.ywwl.com/ts-morph/download/ts-morph-7.0.3.tgz","fileCount":6,"unpackedSize":1495609,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJepg9tCRA9TVsSAnZWagAALIIP/Ay4pCJYmoGHkwnWCOim\nmn8xdmFMn0/qp0dAlN7kSHCahCeV4TZNoF8W3akM1CDpxUqInK4OVC6GaEAb\nKWWubxOUzLz96lXcH1Oj67B266z49UsE/acfG+yVSNZ8CB5LGv0YI5y8cdnl\nXr52DHwOOPdfg+vEVJexNXn88aY9yAwQZdvFOJSYeNn2LyffNpSoBAJ4dw6s\nmcY1yLKjQRCgXjY9EblAn+3q7QYs4x5p8EcLgAxeIQiddBqZ8WrSTuRw8Sji\nVgdOCqBozpl5ikEY6JR9sgh1ILidKylAjLvU9LAy3hv3X0f7Sknhe0OJQDOd\n0fm94oBkGTb/5eTfscM06IY20C4KaJvRLpSemjVnaK8NGbZ1LIa2zkvE5h0j\nIiBlHfevoqJG0S0oPqYyacXhPnxvLq2Np5Ii5Quju/LUtiZX/2barpgI9r6B\nK+0m37COMuwdoQOrh4rZb1W878V8ys8hFlF8YJcfYnePRyXu2ZiqJmtC9IfT\nS++dAlz6dnm3EmF1TRhd7Zh2ajeebYSGprTPM8asVeXAi/C115T54zONrdVg\nNxOhrL7CEC3fmUaho94npwd4Igr9GTFQfNbn0myty32BTEHLx+xcoGW7kpOm\ntaqGwg+datOXDKehv4m4N59Gm5gbDM3DZ4ul/mYI8+bP/z/72HsOi7/kuJWL\nqDYj\r\n=Jmfo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCR22ybVjHf4hR/NVBttYpJ9Y2YoSbXvajfj7/3KbxrkAIhAMuD4CeVS+n7vsqPRT1VLro0TYgCxAxaZybX03/RQuAB"}],"size":213639,"noattachment":false,"key":"/ts-morph/-/ts-morph-7.0.3.tgz"},"maintainers":[{"name":"dsherret","email":"dsherret@gmail.com"}],"_npmUser":{"name":"dsherret","email":"dsherret@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-morph_7.0.3_1587941228906_0.26726332284302434"},"_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":1587941229082,"_cnpm_publish_time":1587941229082,"dist-tags":{"latest":"28.0.0","rc":"2.0.4-rc"}}