File: //opt/code/node_modules/webpack/node_modules/webpack-sources/package.json
{
"name": "webpack-sources",
"version": "1.1.0",
"description": "Source code handling classes for webpack",
"main": "./lib/index.js",
"scripts": {
"pretest": "npm run lint && npm run beautify-lint",
"test": "mocha --full-trace --check-leaks",
"travis": "npm run cover -- --report lcovonly",
"lint": "eslint lib test",
"beautify-lint": "beautify-lint lib/**.js test/**.js",
"beautify": "beautify-rewrite lib/**.js test/**.js",
"precover": "npm run lint && npm run beautify-lint",
"cover": "istanbul cover node_modules/mocha/bin/_mocha",
"publish-patch": "npm test && npm version patch && git push && git push --tags && npm publish"
},
"dependencies": {
"source-list-map": "^2.0.0",
"source-map": "~0.6.1"
},
"devDependencies": {
"beautify-lint": "^1.0.3",
"codecov.io": "^0.1.6",
"coveralls": "^2.11.6",
"eslint": "^3.19.0",
"eslint-plugin-nodeca": "^1.0.3",
"istanbul": "^0.4.1",
"js-beautify": "^1.5.10",
"mocha": "^3.4.2",
"should": "^11.2.1"
},
"files": [
"lib/"
],
"repository": {
"type": "git",
"url": "git+https://github.com/webpack/webpack-sources.git"
},
"keywords": [
"webpack",
"source-map"
],
"author": {
"name": "Tobias Koppers @sokra"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/webpack/webpack-sources/issues"
},
"homepage": "https://github.com/webpack/webpack-sources#readme",
"readme": "# webpack-sources\r\n\r\nContains multiple classes which represent a `Source`. A `Source` can be asked for source code, size, source map and hash.\r\n\r\n## `Source`\r\n\r\nBase class for all sources.\r\n\r\n### Public methods\r\n\r\nAll methods should be considered as expensive as they may need to do computations.\r\n\r\n#### `source`\r\n\r\n``` js\r\nSource.prototype.source() -> String\r\n```\r\n\r\nReturns the represented source code as string.\r\n\r\n#### `size`\r\n\r\n``` js\r\nSource.prototype.size() -> Number\r\n```\r\n\r\nReturns the size in chars of the represented source code.\r\n\r\n#### `map`\r\n\r\n``` js\r\nSource.prototype.map(options: Object) -> Object | null\r\n```\r\n\r\nReturns the SourceMap of the represented source code as JSON. May return `null` if no SourceMap is available.\r\n\r\nThe `options` object can contain the following keys:\r\n\r\n* `columns: Boolean` (default `true`): If set to false the implementation may omit mappings for columns.\r\n* `module: Boolean` (default `true`): If set to false the implementation may omit inner mappings for modules.\r\n\r\n#### `sourceAndMap`\r\n\r\n``` js\r\nSource.prototype.sourceAndMap(options: Object) -> {\r\n\tcode: String,\r\n\tmap: Object\r\n}\r\n```\r\n\r\nReturns both, source code (like `Source.prototype.source()` and SourceMap (like `Source.prototype.map()`). This method could have better performance than calling `source()` and `map()` separatly.\r\n\r\nSee `map()` for `options`.\r\n\r\n#### `updateHash`\r\n\r\n``` js\r\nSource.prototype.updateHash(hash: Hash) -> void\r\n```\r\n\r\nUpdates the provided `Hash` object with the content of the represented source code. (`Hash` is an object with an `update` method, which is called with string values)\r\n\r\n#### `node` (optional)\r\n\r\n``` js\r\nSource.prototype.node(options: Object) -> SourceNode\r\n```\r\n\r\nThis is an optional method. It may be `null` if not implemented.\r\n\r\nReturns a `SourceNode` (see source-map library) for the represented source code.\r\n\r\nSee `map()` for `options`.\r\n\r\n#### `listNode` (optional)\r\n\r\n``` js\r\nSource.prototype.listNode(options: Object) -> SourceNode\r\n```\r\n\r\nThis is an optional method. It may be `null` if not implemented.\r\n\r\nReturns a `SourceListMap` (see source-list-map library) for the represented source code.\r\n\r\nSee `map()` for `options`.\r\n\r\n## `RawSource`\r\n\r\nRepresents source code without SourceMap.\r\n\r\n``` js\r\nnew RawSource(sourceCode: String)\r\n```\r\n\r\n## `OriginalSource`\r\n\r\nRepresents source code, which is a copy of the original file.\r\n\r\n``` js\r\nnew OriginalSource(\r\n\tsourceCode: String,\r\n\tname: String\r\n)\r\n```\r\n\r\n* `sourceCode`: The source code.\r\n* `name`: The filename of the original source code.\r\n\r\nOriginalSource tries to create column mappings if requested, by splitting the source code at typical statement borders (`;`, `{`, `}`).\r\n\r\n## `SourceMapSource`\r\n\r\nRepresents source code with SourceMap, optionally having an additional SourceMap for the original source.\r\n\r\n``` js\r\nnew SourceMapSource(\r\n\tsourceCode: String,\r\n\tname: String,\r\n\tsourceMap: Object | String,\r\n\toriginalSource?: String,\r\n\tinnerSourceMap?: Object | String\r\n)\r\n```\r\n\r\n* `sourceCode`: The source code.\r\n* `name`: The filename of the original source code.\r\n* `sourceMap`: The SourceMap for the source code.\r\n* `originalSource`: The source code of the original file. Can be omitted if the `sourceMap` already contains the original source code.\r\n* `innerSourceMap`: The SourceMap for the `originalSource`/`name`.\r\n\r\n## `LineToLineMappedSource`\r\n\r\nRepresents source code, which is mapped line by line to the original file.\r\n\r\n``` js\r\nnew LineToLineMappedSource(\r\n\tsourceCode: String,\r\n\tname: String,\r\n\toriginalSource: String\r\n)\r\n```\r\n\r\n* `sourceCode`: The source code.\r\n* `name`: The filename of the original source code.\r\n* `originalSource`: The original source code.\r\n\r\n## `CachedSource`\r\n\r\nDecorates a `Source` and caches returned results of `map`, `source`, `size` and `sourceAndMap` in memory. Every other operation is delegated to the wrapped `Source`.\r\n\r\n``` js\r\nnew CachedSource(source: Source)\r\n```\r\n\r\n## `PrefixSource`\r\n\r\nPrefix every line of the decorated `Source` with a provided string.\r\n\r\n``` js\r\nnew PrefixSource(\r\n\tprefix: String,\r\n\tsource: Source\r\n)\r\n```\r\n\r\n## `ConcatSource`\r\n\r\nConcatenate mulitple `Source`s or strings to a single source.\r\n\r\n``` js\r\nnew ConcatSource(\r\n\t...items?: Source | String\r\n)\r\n```\r\n\r\n### Public methods\r\n\r\n#### `add`\r\n\r\n``` js\r\nConcatSource.prototype.add(item: Source | String)\r\n```\r\n\r\nAdds an item to the source.\t\r\n\r\n## `ReplaceSource`\r\n\r\nDecorates a `Source` with replacements and insertions of source code.\r\n\r\n### Public methods\r\n\r\n#### `replace`\r\n\r\n``` js\r\nReplaceSource.prototype.replace(\r\n\tstart: Number,\r\n\tend: Number,\r\n\treplacement: String\r\n)\r\n```\r\n\r\nReplaces chars from `start` (0-indexed, inclusive) to `end` (0-indexed, inclusive) with `replacement`.\r\n\r\nLocations represents locations in the original source and are not influenced by other replacements or insertions.\r\n\r\n#### `insert`\r\n\r\n``` js\r\nReplaceSource.prototype.insert(\r\n\tpos: Number,\r\n\tinsertion: String\r\n)\r\n```\r\n\r\nInserts the `insertion` before char `pos` (0-indexed).\r\n\r\nLocation represents location in the original source and is not influenced by other replacements or insertions.\r\n\r\n#### `original`\r\n\r\nGet decorated `Source`.\r\n\r\n",
"readmeFilename": "README.md",
"_id": "webpack-sources@1.1.0",
"dist": {
"shasum": "77785708e4f8574abf41870725d1270fdbe3338a"
},
"_from": "webpack-sources@^1.0.1",
"_resolved": "http://registry.npmjs.org/webpack-sources/-/webpack-sources-1.1.0.tgz"
}