diff --git a/.editorconfig b/.editorconfig
index 98a761d..1c6314a 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -7,6 +7,6 @@ charset = utf-8
 trim_trailing_whitespace = true
 insert_final_newline = true
 
-[{package.json,*.yml}]
+[*.yml]
 indent_style = space
 indent_size = 2
diff --git a/.gitattributes b/.gitattributes
index 176a458..6313b56 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1 +1 @@
-* text=auto
+* text=auto eol=lf
diff --git a/.gitignore b/.gitignore
index 3c3629e..239ecff 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
 node_modules
+yarn.lock
diff --git a/.npmrc b/.npmrc
new file mode 100644
index 0000000..43c97e7
--- /dev/null
+++ b/.npmrc
@@ -0,0 +1 @@
+package-lock=false
diff --git a/.travis.yml b/.travis.yml
index a78e23d..f3fa8cd 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,7 +1,4 @@
-sudo: false
 language: node_js
 node_js:
-  - '5'
-  - '4'
-  - '0.12'
-  - '0.10'
+  - '10'
+  - '8'
diff --git a/debian/changelog b/debian/changelog
index 0013fe1..8975d73 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+node-strip-indent (3.0.0-1) UNRELEASED; urgency=medium
+
+  * New upstream release.
+
+ -- Debian Janitor <janitor@jelmer.uk>  Thu, 28 Nov 2019 08:22:46 +0000
+
 node-strip-indent (2.0.0-1) unstable; urgency=low
 
   * Initial release (Closes: #841998)
diff --git a/index.d.ts b/index.d.ts
new file mode 100644
index 0000000..44f2304
--- /dev/null
+++ b/index.d.ts
@@ -0,0 +1,21 @@
+/**
+Strip leading whitespace from each line in a string.
+
+The line with the least number of leading whitespace, ignoring empty lines, determines the number to remove.
+
+@example
+```
+import stripIndent = require('strip-indent');
+
+const string = '\tunicorn\n\t\tcake';
+//	unicorn
+//		cake
+
+stripIndent(string);
+//unicorn
+//	cake
+```
+*/
+declare function stripIndent(string: string): string;
+
+export = stripIndent;
diff --git a/index.js b/index.js
index c90b265..7ba3b15 100644
--- a/index.js
+++ b/index.js
@@ -1,14 +1,14 @@
 'use strict';
-module.exports = str => {
-	const match = str.match(/^[ \t]*(?=\S)/gm);
+const minIndent = require('min-indent');
 
-	if (!match) {
-		return str;
+module.exports = string => {
+	const indent = minIndent(string);
+
+	if (indent === 0) {
+		return string;
 	}
 
-	// TODO: use spread operator when targeting Node.js 6
-	const indent = Math.min.apply(Math, match.map(x => x.length)); // eslint-disable-line
-	const re = new RegExp(`^[ \\t]{${indent}}`, 'gm');
+	const regex = new RegExp(`^[ \\t]{${indent}}`, 'gm');
 
-	return indent > 0 ? str.replace(re, '') : str;
+	return string.replace(regex, '');
 };
diff --git a/index.test-d.ts b/index.test-d.ts
new file mode 100644
index 0000000..a51617c
--- /dev/null
+++ b/index.test-d.ts
@@ -0,0 +1,4 @@
+import {expectType} from 'tsd';
+import stripIndent = require('.');
+
+expectType<string>(stripIndent('\tunicorn\n\t\tcake'));
diff --git a/license b/license
index 654d0bf..e7af2f7 100644
--- a/license
+++ b/license
@@ -1,21 +1,9 @@
-The MIT License (MIT)
+MIT License
 
 Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
 
-Permission 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:
+Permission 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:
 
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
 
-THE 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.
+THE 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.
diff --git a/package.json b/package.json
index 334dc8b..d66a003 100644
--- a/package.json
+++ b/package.json
@@ -1,41 +1,42 @@
 {
-  "name": "strip-indent",
-  "version": "2.0.0",
-  "description": "Strip leading whitespace from each line in a string",
-  "license": "MIT",
-  "repository": "sindresorhus/strip-indent",
-  "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
-  }
+	"name": "strip-indent",
+	"version": "3.0.0",
+	"description": "Strip leading whitespace from each line in a string",
+	"license": "MIT",
+	"repository": "sindresorhus/strip-indent",
+	"author": {
+		"name": "Sindre Sorhus",
+		"email": "sindresorhus@gmail.com",
+		"url": "sindresorhus.com"
+	},
+	"engines": {
+		"node": ">=8"
+	},
+	"scripts": {
+		"test": "xo && ava && tsd"
+	},
+	"files": [
+		"index.js",
+		"index.d.ts"
+	],
+	"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"
+	}
 }
diff --git a/readme.md b/readme.md
index db979cd..f14f6ba 100644
--- a/readme.md
+++ b/readme.md
@@ -10,7 +10,7 @@ Useful for removing redundant indentation.
 ## Install
 
 ```
-$ npm install --save strip-indent
+$ npm install strip-indent
 ```
 
 
@@ -19,13 +19,13 @@ $ npm install --save strip-indent
 ```js
 const stripIndent = require('strip-indent');
 
-const str = '\tunicorn\n\t\tcake';
+const string = '\tunicorn\n\t\tcake';
 /*
 	unicorn
 		cake
 */
 
-stripIndent('\tunicorn\n\t\tcake');
+stripIndent(string);
 /*
 unicorn
 	cake
diff --git a/test.js b/test.js
index 40cbc04..90fa4c4 100644
--- a/test.js
+++ b/test.js
@@ -1,9 +1,9 @@
 import test from 'ava';
-import m from './';
+import stripIndent from '.';
 
-test(t => {
-	t.is(m('\nunicorn\n'), '\nunicorn\n');
-	t.is(m('\n  unicorn\n'), '\nunicorn\n');
-	t.is(m('\t\t<!doctype html>\n\t\t<html>\n\t\t\t<body>\n\n\n\n\t\t\t\t<h1>Hello world!</h1>\n\t\t\t</body>\n\t\t</html>'), '<!doctype html>\n<html>\n\t<body>\n\n\n\n\t\t<h1>Hello world!</h1>\n\t</body>\n</html>');
-	t.is(m('\n\t\n\t\tunicorn\n\n\n\n\t\t\tunicorn'), '\n\t\nunicorn\n\n\n\n\tunicorn', 'ignore whitespace only lines');
+test('main', t => {
+	t.is(stripIndent('\nunicorn\n'), '\nunicorn\n');
+	t.is(stripIndent('\n  unicorn\n'), '\nunicorn\n');
+	t.is(stripIndent('\t\t<!doctype html>\n\t\t<html>\n\t\t\t<body>\n\n\n\n\t\t\t\t<h1>Hello world!</h1>\n\t\t\t</body>\n\t\t</html>'), '<!doctype html>\n<html>\n\t<body>\n\n\n\n\t\t<h1>Hello world!</h1>\n\t</body>\n</html>');
+	t.is(stripIndent('\n\t\n\t\tunicorn\n\n\n\n\t\t\tunicorn'), '\n\t\nunicorn\n\n\n\n\tunicorn', 'ignore whitespace only lines');
 });