You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
92 lines
4.5 KiB
JSON
92 lines
4.5 KiB
JSON
{
|
|
"_args": [
|
|
[
|
|
{
|
|
"raw": "esrefactor@~0.1.0",
|
|
"scope": null,
|
|
"escapedName": "esrefactor",
|
|
"name": "esrefactor",
|
|
"rawSpec": "~0.1.0",
|
|
"spec": ">=0.1.0 <0.2.0",
|
|
"type": "range"
|
|
},
|
|
"/Users/MB/git/pdfkit/node_modules/derequire"
|
|
]
|
|
],
|
|
"_from": "esrefactor@>=0.1.0 <0.2.0",
|
|
"_id": "esrefactor@0.1.0",
|
|
"_inCache": true,
|
|
"_location": "/esrefactor",
|
|
"_npmUser": {
|
|
"name": "ariya",
|
|
"email": "ariya.hidayat@gmail.com"
|
|
},
|
|
"_npmVersion": "1.1.61",
|
|
"_phantomChildren": {},
|
|
"_requested": {
|
|
"raw": "esrefactor@~0.1.0",
|
|
"scope": null,
|
|
"escapedName": "esrefactor",
|
|
"name": "esrefactor",
|
|
"rawSpec": "~0.1.0",
|
|
"spec": ">=0.1.0 <0.2.0",
|
|
"type": "range"
|
|
},
|
|
"_requiredBy": [
|
|
"/derequire"
|
|
],
|
|
"_resolved": "https://registry.npmjs.org/esrefactor/-/esrefactor-0.1.0.tgz",
|
|
"_shasum": "d142795a282339ab81e936b5b7a21b11bf197b13",
|
|
"_shrinkwrap": null,
|
|
"_spec": "esrefactor@~0.1.0",
|
|
"_where": "/Users/MB/git/pdfkit/node_modules/derequire",
|
|
"bugs": {
|
|
"url": "https://github.com/ariya/esrefactor/issues"
|
|
},
|
|
"dependencies": {
|
|
"escope": "~0.0.13",
|
|
"esprima": "~1.0.2",
|
|
"estraverse": "~0.0.4"
|
|
},
|
|
"description": "ECMAScript refactoring helper",
|
|
"devDependencies": {
|
|
"istanbul": "~0.1.33"
|
|
},
|
|
"directories": {},
|
|
"dist": {
|
|
"shasum": "d142795a282339ab81e936b5b7a21b11bf197b13",
|
|
"tarball": "https://registry.npmjs.org/esrefactor/-/esrefactor-0.1.0.tgz"
|
|
},
|
|
"engines": {
|
|
"node": ">=0.4.0"
|
|
},
|
|
"homepage": "https://github.com/ariya/esrefactor#readme",
|
|
"licenses": [
|
|
{
|
|
"type": "BSD",
|
|
"url": "http://github.com/ariya/esrefactor/raw/master/LICENSE.BSD"
|
|
}
|
|
],
|
|
"main": "lib/esrefactor.js",
|
|
"maintainers": [
|
|
{
|
|
"name": "ariya",
|
|
"email": "ariya.hidayat@gmail.com"
|
|
}
|
|
],
|
|
"name": "esrefactor",
|
|
"optionalDependencies": {},
|
|
"readme": "**esrefactor** (BSD licensed) is a little helper library for ECMAScript refactoring.\n\n## Usage\n\nWith Node.js:\n\n```bash\nnpm install esrefactor\n```\n\nIn a browser, include first all the dependents:\n\n```\n<!-- esrefactor depends on these libraries -->\n<script src=\"esprima.js\"></src>\n<script src=\"estraverse.js\"></src>\n<script src=\"escope.js\"></src>\n\n<script src=\"esrefactor.js\"></src>\n```\n## API\n\nBefore using the API, a context needs to be created:\n\n```javascript\nvar ctx = new esrefactor.Context(code);\n```\n\nwhere `code` is the source code.\n\n### Identification\n\nAn identifier, whether it is a variable, a function name, or a function\nparameter, can be identified using `identify()`. Example:\n\n```javascript\nvar ctx = new esrefactor.Context('var x = 42; y = x * 2; z = x / 2');\nvar id = ctx.identify(4);\n```\n\nThe only argument to `identify` is the zero-based position index.\n\nThe return object has 3 (three) properties:\n\n* `identifier`: the syntax node associated with the position\n* `declaration`: the declaration syntax node for the identifier\n* `references`: an array of all identical references\n\nIf there is no declaration for the identifier (e.g. `x = 42`, global\nleak), then `declaration` will be _null_.\n\nThe resolution of the declaration syntax node and the references array\ntake into account the identifier scope as defined in the official\nECMAScript 5.1 Specification (ECMA-262).\n\nNote that if there is no identifier in the given position index,\n`identify()` will return _undefined_.\n\n### Renaming\n\nAn identifier can be renamed using `rename()`. All other identical references\nassociated with that identifier will be renamed as well, again taking into\naccount the proper identifier scope. Renaming works for variable declaration,\nfunction name, and function parameter.\n\nFor `rename()` to work, it needs to have the identification result\n(via `identify`) and the new name for the identifier.\n\n```javascript\nvar ctx = new esrefactor.Context('var x; x = 42');\nvar id = ctx.identify(4);\nvar code = ctx.rename(id, 'answer');\n```\nIn the above example, `code` is `var answer; answer = 42`.\n\n",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "git+ssh://git@github.com/ariya/esrefactor.git"
|
|
},
|
|
"scripts": {
|
|
"analyze-coverage": "node node_modules/istanbul/lib/cli.js cover test/run.js",
|
|
"check-coverage": "node node_modules/istanbul/lib/cli.js check-coverage --statement -2 --branch -4 --function 100",
|
|
"coverage": "npm run-script analyze-coverage && npm run-script check-coverage",
|
|
"test": "node test/run.js && npm run-script coverage"
|
|
},
|
|
"version": "0.1.0"
|
|
}
|