{"id":15497488,"url":"https://github.com/heapwolf/codesurgeon","last_synced_at":"2025-06-27T11:32:38.948Z","repository":{"id":57202549,"uuid":"2482965","full_name":"heapwolf/codesurgeon","owner":"heapwolf","description":"[DEPRECATED] Build a subset or superset of a javascript codebase via reading the AST.","archived":false,"fork":false,"pushed_at":"2016-05-01T18:34:08.000Z","size":121,"stargazers_count":163,"open_issues_count":8,"forks_count":5,"subscribers_count":6,"default_branch":"esprima","last_synced_at":"2024-10-30T01:34:43.866Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/heapwolf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-09-29T15:45:16.000Z","updated_at":"2019-08-13T14:50:49.000Z","dependencies_parsed_at":"2022-09-15T13:21:50.888Z","dependency_job_id":null,"html_url":"https://github.com/heapwolf/codesurgeon","commit_stats":null,"previous_names":["hij1nx/codesurgeon"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heapwolf%2Fcodesurgeon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heapwolf%2Fcodesurgeon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heapwolf%2Fcodesurgeon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heapwolf%2Fcodesurgeon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heapwolf","download_url":"https://codeload.github.com/heapwolf/codesurgeon/tar.gz/refs/heads/esprima","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248914192,"owners_count":21182376,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-02T08:38:35.986Z","updated_at":"2025-04-14T16:21:58.128Z","avatar_url":"https://github.com/heapwolf.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DEPRECATED\n\nYou should use Facebook's module -- https://github.com/facebook/jscodeshift\n\n# SYNOPSIS\nBuild a subset or superset of a code base.\n\n# DESCRIPTION\nRather than breaking apart files at design-time for the purpose of targeted\ndistribution, you can break them apart using a filter at build-time. \n\n\n# EXAMPLES\nAs the Javascript file is traversed and syntax is discovered, you will have the\nopportunity to interject, for example:\n\n### Input\n```js\nvar a = 10\nvar b = 11\nvar c = 12\n```\n\n### Code\n\n```js\nvar cs = require('codesurgeon')\n\nvar filter = cs.filter()\n\nfilter.inclusive = true\n\nfilter.syntax.VariableDeclaration = function(name, item) {\n  if (name === 'b') {\n    return true\n  }\n}\n\nfstream\n  .Reader('example.js')\n  .pipe(filter)\n  .pipe(process.stdout)\n```\n\n### Output\n```js\nvar b = 11\n```\n\nA filter supports a streaming style API, but most operations block processing so\nthis is purely for convenience.\n\n# Syntax Reference\n\n`AssignmentExpression`\n`ArrayExpression`\n`ArrayPattern`\n`BlockStatement`\n`BinaryExpression`\n`BreakStatement`\n`CallExpression`\n`CatchClause`\n`ComprehensionBlock`\n`ComprehensionExpression`\n`ConditionalExpression`\n`ContinueStatement`\n`DirectiveStatement`\n`DoWhileStatement`\n`DebuggerStatement`\n`EmptyStatement`\n`ExpressionStatement`\n`ForStatement`\n`ForInStatement`\n`FunctionDeclaration`\n`FunctionExpression`\n`Identifier`\n`IfStatement`\n`Literal`\n`LabeledStatement`\n`LogicalExpression`\n`MemberExpression`\n`NewExpression`\n`ObjectExpression`\n`ObjectPattern`\n`Program`\n`Property`\n`ReturnStatement`\n`SequenceExpression`\n`SwitchStatement`\n`SwitchCase`\n`ThisExpression`\n`ThrowStatement`\n`TryStatement`\n`UnaryExpression`\n`UpdateExpression`\n`VariableDeclaration`\n`VariableDeclarator`\n`WhileStatement`\n`WithStatement`\n`YieldExpression`\n\n# LICENSE\n(The MIT License)\n\nCopyright (c) 2010 hij1nx \u003chttp://www.twitter.com/hij1nx\u003e\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheapwolf%2Fcodesurgeon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheapwolf%2Fcodesurgeon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheapwolf%2Fcodesurgeon/lists"}