{"_id":"strip-indent","_rev":"4421223","name":"strip-indent","description":"Strip leading whitespace from each line in a string","dist-tags":{"latest":"4.1.1"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2026-04-08T13:35:07.000Z","created":"2014-03-29T14:17:34.079Z","4.1.1":"2025-10-12T14:55:54.463Z","4.1.0":"2025-09-11T12:43:29.103Z","4.0.0":"2021-05-03T14:34:25.101Z","3.0.0":"2019-04-17T02:21:49.701Z","2.0.0":"2016-04-22T05:47:23.270Z","1.0.1":"2015-02-16T18:02:14.906Z","1.0.0":"2014-08-13T13:43:55.144Z","0.1.3":"2014-04-29T19:53:29.543Z","0.1.2":"2014-04-16T14:26:44.956Z","0.1.1":"2014-04-06T22:49:58.455Z","0.1.0":"2014-03-29T14:17:34.079Z"},"users":{"mlm":true},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/strip-indent.git"},"versions":{"4.1.1":{"name":"strip-indent","version":"4.1.1","description":"Strip leading whitespace from each line in a string","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/strip-indent.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":">=12"},"scripts":{"test":"xo && ava"},"keywords":["strip","indent","indentation","normalize","remove","delete","whitespace","space","tab","string","dedent"],"devDependencies":{"ava":"^3.15.0","xo":"^0.39.1"},"gitHead":"102b553f9efaec1c2451cd9ac2385269768f1fed","types":"./index.d.ts","_id":"strip-indent@4.1.1","bugs":{"url":"https://github.com/sindresorhus/strip-indent/issues"},"homepage":"https://github.com/sindresorhus/strip-indent#readme","_nodeVersion":"20.19.5","_npmVersion":"11.6.1","dist":{"shasum":"aba13de189d4ad9a17f6050e76554ac27585c7af","size":2014,"noattachment":false,"key":"/strip-indent/-/strip-indent-4.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/strip-indent/download/strip-indent-4.1.1.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/strip-indent_4.1.1_1760280954293_0.0248457451731523"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-10-12T14:55:54.463Z","publish_time":1760280954463,"_source_registry_name":"default","_cnpm_publish_time":1760280954463},"4.1.0":{"name":"strip-indent","version":"4.1.0","description":"Strip leading whitespace from each line in a string","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/strip-indent.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":">=12"},"scripts":{"test":"xo && ava"},"keywords":["strip","indent","indentation","normalize","remove","delete","whitespace","space","tab","string","dedent"],"devDependencies":{"ava":"^3.15.0","xo":"^0.39.1"},"_id":"strip-indent@4.1.0","gitHead":"0d3cfcafffeba020e725b1ef362fcf2b147f02fc","types":"./index.d.ts","bugs":{"url":"https://github.com/sindresorhus/strip-indent/issues"},"homepage":"https://github.com/sindresorhus/strip-indent#readme","_nodeVersion":"20.19.1","_npmVersion":"10.9.2","dist":{"shasum":"8658a77cece02a4f27064bdb0a459257edb565f6","size":2023,"noattachment":false,"key":"/strip-indent/-/strip-indent-4.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/strip-indent/download/strip-indent-4.1.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/strip-indent_4.1.0_1757594608898_0.004637956060737247"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-09-11T12:43:29.103Z","publish_time":1757594609103,"_source_registry_name":"default","_cnpm_publish_time":1757594609103},"4.0.0":{"name":"strip-indent","version":"4.0.0","description":"Strip leading whitespace from each line in a string","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/strip-indent.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":">=12"},"scripts":{"test":"xo && ava && tsd"},"keywords":["strip","indent","indentation","normalize","remove","delete","whitespace","space","tab","string"],"dependencies":{"min-indent":"^1.0.1"},"devDependencies":{"ava":"^3.15.0","tsd":"^0.14.0","xo":"^0.39.1"},"gitHead":"10584084ff795abfb7b3ae1862d554eaaebb9696","bugs":{"url":"https://github.com/sindresorhus/strip-indent/issues"},"homepage":"https://github.com/sindresorhus/strip-indent#readme","_id":"strip-indent@4.0.0","_nodeVersion":"16.0.0","_npmVersion":"7.10.0","dist":{"shasum":"b41379433dd06f5eae805e21d631e07ee670d853","size":1882,"noattachment":false,"key":"/strip-indent/-/strip-indent-4.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/strip-indent/download/strip-indent-4.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/strip-indent_4.0.0_1620052464737_0.051673866153164605"},"_hasShrinkwrap":false,"publish_time":1620052465101,"_cnpm_publish_time":1620052465101},"3.0.0":{"name":"strip-indent","version":"3.0.0","description":"Strip leading whitespace from each line in a string","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/strip-indent.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["strip","indent","indentation","normalize","remove","delete","whitespace","space","tab","string"],"dependencies":{"min-indent":"^1.0.0"},"devDependencies":{"ava":"^1.4.1","tsd":"^0.7.2","xo":"^0.24.0"},"gitHead":"b537c94fd8376e4205146fbbef0bc08a477c5eab","bugs":{"url":"https://github.com/sindresorhus/strip-indent/issues"},"homepage":"https://github.com/sindresorhus/strip-indent#readme","_id":"strip-indent@3.0.0","_nodeVersion":"8.15.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"c32e1cee940b6b3432c771bc2c54bcce73cd3001","size":1719,"noattachment":false,"key":"/strip-indent/-/strip-indent-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/strip-indent/download/strip-indent-3.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/strip-indent_3.0.0_1555467709598_0.2614391651361543"},"_hasShrinkwrap":false,"publish_time":1555467709701,"_cnpm_publish_time":1555467709701},"2.0.0":{"name":"strip-indent","version":"2.0.0","description":"Strip leading whitespace from each line in a string","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/strip-indent.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["strip","indent","indentation","normalize","remove","delete","whitespace","space","tab","string","str"],"devDependencies":{"ava":"*","xo":"*"},"xo":{"esnext":true},"gitHead":"459f98737dd57252ea63268c4686b939d40579ae","bugs":{"url":"https://github.com/sindresorhus/strip-indent/issues"},"homepage":"https://github.com/sindresorhus/strip-indent#readme","_id":"strip-indent@2.0.0","_shasum":"5ef8db295d01e6ed6cbf7aab96998d7822527b68","_from":".","_npmVersion":"3.8.7","_nodeVersion":"4.4.2","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"5ef8db295d01e6ed6cbf7aab96998d7822527b68","size":1752,"noattachment":false,"key":"/strip-indent/-/strip-indent-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/strip-indent/download/strip-indent-2.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/strip-indent-2.0.0.tgz_1461304042785_0.2992539571132511"},"directories":{},"publish_time":1461304043270,"_cnpm_publish_time":1461304043270,"_hasShrinkwrap":false},"1.0.1":{"name":"strip-indent","version":"1.0.1","description":"Strip leading whitespace from every line in a string","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/strip-indent"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"bin":{"strip-indent":"cli.js"},"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"files":["index.js","cli.js"],"keywords":["cli","bin","browser","strip","normalize","remove","indent","indentation","whitespace","space","tab","string","str"],"devDependencies":{"mocha":"*"},"dependencies":{"get-stdin":"^4.0.1"},"gitHead":"addcf90a56001ea122e9f1254987016bc87e5b5f","bugs":{"url":"https://github.com/sindresorhus/strip-indent/issues"},"homepage":"https://github.com/sindresorhus/strip-indent","_id":"strip-indent@1.0.1","_shasum":"0c7962a6adefa7bbd4ac366460a638552ae1a0a2","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"dist":{"shasum":"0c7962a6adefa7bbd4ac366460a638552ae1a0a2","size":2117,"noattachment":false,"key":"/strip-indent/-/strip-indent-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/strip-indent/download/strip-indent-1.0.1.tgz"},"directories":{},"publish_time":1424109734906,"_cnpm_publish_time":1424109734906,"_hasShrinkwrap":false},"1.0.0":{"name":"strip-indent","version":"1.0.0","description":"Strip leading whitespace from every line in a string","license":"MIT","repository":{"type":"git","url":"git://github.com/sindresorhus/strip-indent"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"bin":{"strip-indent":"cli.js"},"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"files":["index.js","cli.js"],"keywords":["cli","bin","browser","strip","normalize","remove","indent","indentation","whitespace","space","tab","string","str"],"devDependencies":{"mocha":"*"},"dependencies":{"get-stdin":"^1.0.0"},"gitHead":"0b11b5a23a7dc61b6363ef61939115a17f509167","bugs":{"url":"https://github.com/sindresorhus/strip-indent/issues"},"homepage":"https://github.com/sindresorhus/strip-indent","_id":"strip-indent@1.0.0","_shasum":"c2425adedb2163f01ffd4ba5fdae1c9f80900285","_from":".","_npmVersion":"1.4.14","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"dist":{"shasum":"c2425adedb2163f01ffd4ba5fdae1c9f80900285","size":1420,"noattachment":false,"key":"/strip-indent/-/strip-indent-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/strip-indent/download/strip-indent-1.0.0.tgz"},"directories":{},"publish_time":1407937435144,"_cnpm_publish_time":1407937435144,"_hasShrinkwrap":false},"0.1.3":{"name":"strip-indent","version":"0.1.3","description":"Strip leading whitespace from every line in a string","license":"MIT","repository":{"type":"git","url":"git://github.com/sindresorhus/strip-indent"},"bin":{"strip-indent":"cli.js"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha","browser":"browserify -s $npm_package_name -o browser.js ."},"files":["index.js","cli.js"],"keywords":["cli","bin","browser","strip","normalize","remove","indent","indentation","whitespace","space","tab","string","str"],"devDependencies":{"mocha":"*","browserify":"^3.0.0"},"bugs":{"url":"https://github.com/sindresorhus/strip-indent/issues"},"homepage":"https://github.com/sindresorhus/strip-indent","_id":"strip-indent@0.1.3","dist":{"shasum":"c43ccb66c24e49c4e27b2236d34fe2c4bbcf14dc","size":1510,"noattachment":false,"key":"/strip-indent/-/strip-indent-0.1.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/strip-indent/download/strip-indent-0.1.3.tgz"},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"publish_time":1398801209543,"_cnpm_publish_time":1398801209543,"_hasShrinkwrap":false},"0.1.2":{"name":"strip-indent","version":"0.1.2","description":"Strip leading whitespace from every line in a string","license":"MIT","repository":{"type":"git","url":"git://github.com/sindresorhus/strip-indent"},"bin":{"strip-indent":"cli.js"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha","browser":"browserify -s $npm_package_name -o browser.js ."},"files":["index.js","cli.js"],"keywords":["cli","bin","browser","strip","normalize","remove","indent","indentation","whitespace","space","tab","string","str"],"devDependencies":{"mocha":"*","browserify":"^3.0.0"},"bugs":{"url":"https://github.com/sindresorhus/strip-indent/issues"},"homepage":"https://github.com/sindresorhus/strip-indent","_id":"strip-indent@0.1.2","dist":{"shasum":"b48df2fc0b4ca737d5b3329d5ed2b1ba26a420a6","size":1512,"noattachment":false,"key":"/strip-indent/-/strip-indent-0.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/strip-indent/download/strip-indent-0.1.2.tgz"},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"publish_time":1397658404956,"_cnpm_publish_time":1397658404956,"_hasShrinkwrap":false},"0.1.1":{"name":"strip-indent","version":"0.1.1","description":"Strip leading whitespace from every line in a string","license":"MIT","repository":{"type":"git","url":"git://github.com/sindresorhus/strip-indent"},"bin":{"strip-indent":"cli.js"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha","browser":"a=$npm_package_name; browserify -r ./index:$a -s $a index.js -o browser.js"},"files":["index.js","cli.js"],"keywords":["cli","bin","browser","strip","normalize","remove","indent","indentation","whitespace","space","tab","string","str"],"devDependencies":{"mocha":"*","browserify":"^3.0.0"},"bugs":{"url":"https://github.com/sindresorhus/strip-indent/issues"},"homepage":"https://github.com/sindresorhus/strip-indent","_id":"strip-indent@0.1.1","dist":{"shasum":"634e8410a63e7ec2f90845a768110d70ad925fdf","size":1642,"noattachment":false,"key":"/strip-indent/-/strip-indent-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/strip-indent/download/strip-indent-0.1.1.tgz"},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"publish_time":1396824598455,"_cnpm_publish_time":1396824598455,"_hasShrinkwrap":false},"0.1.0":{"name":"strip-indent","version":"0.1.0","description":"Strip leading whitespace from every line in a string","license":"MIT","repository":{"type":"git","url":"git://github.com/sindresorhus/strip-indent"},"bin":{"strip-indent":"cli.js"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha","browser":"a=$npm_package_name; browserify -r ./index:$a -s $a index.js -o browser.js"},"files":["index.js","cli.js"],"keywords":["cli","bin","browser","strip","normalize","remove","indent","indentation","whitespace","space","tab","string","str"],"devDependencies":{"mocha":"*","browserify":"^3.0.0"},"bugs":{"url":"https://github.com/sindresorhus/strip-indent/issues"},"homepage":"https://github.com/sindresorhus/strip-indent","_id":"strip-indent@0.1.0","dist":{"shasum":"80b081845da5d3c0adc0d89e3b10199f8c6cff37","size":1625,"noattachment":false,"key":"/strip-indent/-/strip-indent-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/strip-indent/download/strip-indent-0.1.0.tgz"},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"publish_time":1396102654079,"_cnpm_publish_time":1396102654079,"_hasShrinkwrap":false}},"readme":"# strip-indent\n\n> Strip leading whitespace from each line in a string\n\nThe line with the least number of leading whitespace, ignoring empty lines, determines the number to remove.\n\nUseful for removing redundant indentation.\n\n## Install\n\n```sh\nnpm install strip-indent\n```\n\n## Usage\n\n```js\nimport stripIndent from 'strip-indent';\n\nconst string = '\\tunicorn\\n\\t\\tcake';\n/*\n\tunicorn\n\t\tcake\n*/\n\nstripIndent(string);\n/*\nunicorn\n\tcake\n*/\n```\n\n## API\n\n### stripIndent(string)\n\nStrip leading whitespace from each line in a string.\n\nThe line with the least number of leading whitespace, ignoring empty lines, determines the number to remove.\n\n### dedent(string)\n\nStrip leading whitespace from each line in a string and remove surrounding blank lines.\n\nLike `stripIndent()`, but also removes leading and trailing lines that contain only whitespace. Useful for template literals and multi-line strings where you want clean boundaries.\n\n```js\nimport {dedent} from 'strip-indent';\n\ndedent(`\n\tunicorn\n\t\tcake\n`);\n/*\nunicorn\n\tcake\n*/\n```\n\n## Related\n\n- [strip-indent-cli](https://github.com/sindresorhus/strip-indent-cli) - CLI for this module\n- [indent-string](https://github.com/sindresorhus/indent-string) - Indent each line in a string\n- [redent](https://github.com/sindresorhus/redent) - Strip redundant indentation and indent the string\n","_attachments":{},"homepage":"https://github.com/sindresorhus/strip-indent#readme","bugs":{"url":"https://github.com/sindresorhus/strip-indent/issues"},"license":"MIT"}