├── .editorconfig ├── .gitattributes ├── .github ├── security.md └── workflows │ └── main.yml ├── .gitignore ├── .npmrc ├── index.d.ts ├── index.js ├── license ├── package.json ├── readme.md ├── test.js └── text-extensions.json /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = tab 5 | end_of_line = lf 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | 10 | [*.yml] 11 | indent_style = space 12 | indent_size = 2 13 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto eol=lf 2 | -------------------------------------------------------------------------------- /.github/security.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. 4 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | on: 3 | - push 4 | - pull_request 5 | jobs: 6 | test: 7 | name: Node.js ${{ matrix.node-version }} 8 | runs-on: ubuntu-latest 9 | strategy: 10 | fail-fast: false 11 | matrix: 12 | node-version: 13 | - 20 14 | - 18 15 | steps: 16 | - uses: actions/checkout@v4 17 | - uses: actions/setup-node@v4 18 | with: 19 | node-version: ${{ matrix.node-version }} 20 | - run: npm install 21 | - run: npm test 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | yarn.lock 3 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | package-lock=false 2 | -------------------------------------------------------------------------------- /index.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | List of text file extensions. 3 | 4 | @example 5 | ``` 6 | import textExtensions from 'text-extensions'; 7 | 8 | console.log(textExtensions); 9 | //=> ['asp', 'aspx', …] 10 | ``` 11 | */ 12 | declare const textExtensions: readonly string[]; 13 | 14 | export default textExtensions; 15 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | import textExtensions from './text-extensions.json' with {type: 'json'}; 2 | 3 | export default textExtensions; 4 | -------------------------------------------------------------------------------- /license: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Sindre Sorhus (https://sindresorhus.com) 4 | 5 | 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: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | 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. 10 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "text-extensions", 3 | "version": "3.1.0", 4 | "description": "List of text file extensions", 5 | "license": "MIT", 6 | "repository": "sindresorhus/text-extensions", 7 | "funding": "https://github.com/sponsors/sindresorhus", 8 | "author": { 9 | "name": "Sindre Sorhus", 10 | "email": "sindresorhus@gmail.com", 11 | "url": "https://sindresorhus.com" 12 | }, 13 | "type": "module", 14 | "exports": { 15 | "types": "./index.d.ts", 16 | "default": "./index.js" 17 | }, 18 | "sideEffects": false, 19 | "engines": { 20 | "node": ">=18.20" 21 | }, 22 | "scripts": { 23 | "//test": "xo && ava && tsc --noEmit index.d.ts", 24 | "test": "ava && tsc --noEmit index.d.ts" 25 | }, 26 | "files": [ 27 | "index.js", 28 | "index.d.ts", 29 | "text-extensions.json" 30 | ], 31 | "keywords": [ 32 | "text", 33 | "ascii", 34 | "extensions", 35 | "extension", 36 | "file", 37 | "json", 38 | "list", 39 | "array" 40 | ], 41 | "devDependencies": { 42 | "ava": "^6.1.2", 43 | "typescript": "^5.4.5", 44 | "xo": "^0.58.0" 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # text-extensions 2 | 3 | > List of text file extensions 4 | 5 | The list is just a [JSON file](text-extensions.json) and can be used anywhere. 6 | 7 | ## Install 8 | 9 | ```sh 10 | npm install text-extensions 11 | ``` 12 | 13 | ## Usage 14 | 15 | ```js 16 | import textExtensions from 'text-extensions'; 17 | 18 | console.log(textExtensions); 19 | //=> ['asp', 'aspx', …] 20 | ``` 21 | 22 | ## Related 23 | 24 | - [is-text-path](https://github.com/sindresorhus/is-text-path) - Check if a file path is a text file 25 | - [binary-extensions](https://github.com/sindresorhus/binary-extensions) - List of binary file extensions 26 | -------------------------------------------------------------------------------- /test.js: -------------------------------------------------------------------------------- 1 | import test from 'ava'; 2 | import textExtensions from './index.js'; 3 | 4 | test('main', t => { 5 | t.true(Array.isArray(textExtensions)); 6 | t.true(textExtensions.length > 0); 7 | }); 8 | -------------------------------------------------------------------------------- /text-extensions.json: -------------------------------------------------------------------------------- 1 | [ 2 | "ada", 3 | "adb", 4 | "ads", 5 | "applescript", 6 | "as", 7 | "asc", 8 | "ascii", 9 | "ascx", 10 | "asm", 11 | "asmx", 12 | "asp", 13 | "aspx", 14 | "atom", 15 | "au3", 16 | "awk", 17 | "bas", 18 | "bash", 19 | "bashrc", 20 | "bat", 21 | "bbcolors", 22 | "bcp", 23 | "bdsgroup", 24 | "bdsproj", 25 | "bib", 26 | "bowerrc", 27 | "c", 28 | "cbl", 29 | "cc", 30 | "cfc", 31 | "cfg", 32 | "cfm", 33 | "cfml", 34 | "cgi", 35 | "cjs", 36 | "clj", 37 | "cljs", 38 | "cls", 39 | "cmake", 40 | "cmd", 41 | "cnf", 42 | "cob", 43 | "code-snippets", 44 | "coffee", 45 | "coffeekup", 46 | "conf", 47 | "cp", 48 | "cpp", 49 | "cpt", 50 | "cpy", 51 | "crt", 52 | "cs", 53 | "csh", 54 | "cson", 55 | "csproj", 56 | "csr", 57 | "css", 58 | "csslintrc", 59 | "csv", 60 | "ctl", 61 | "cts", 62 | "curlrc", 63 | "cxx", 64 | "d", 65 | "dart", 66 | "dfm", 67 | "diff", 68 | "dof", 69 | "dpk", 70 | "dpr", 71 | "dproj", 72 | "dtd", 73 | "eco", 74 | "editorconfig", 75 | "ejs", 76 | "el", 77 | "elm", 78 | "emacs", 79 | "eml", 80 | "ent", 81 | "erb", 82 | "erl", 83 | "eslintignore", 84 | "eslintrc", 85 | "ex", 86 | "exs", 87 | "f", 88 | "f03", 89 | "f77", 90 | "f90", 91 | "f95", 92 | "fish", 93 | "for", 94 | "fpp", 95 | "frm", 96 | "fs", 97 | "fsproj", 98 | "fsx", 99 | "ftn", 100 | "gemrc", 101 | "gemspec", 102 | "gitattributes", 103 | "gitconfig", 104 | "gitignore", 105 | "gitkeep", 106 | "gitmodules", 107 | "go", 108 | "gpp", 109 | "gradle", 110 | "graphql", 111 | "groovy", 112 | "groupproj", 113 | "grunit", 114 | "gtmpl", 115 | "gvimrc", 116 | "h", 117 | "haml", 118 | "hbs", 119 | "hgignore", 120 | "hh", 121 | "hpp", 122 | "hrl", 123 | "hs", 124 | "hta", 125 | "htaccess", 126 | "htc", 127 | "htm", 128 | "html", 129 | "htpasswd", 130 | "hxx", 131 | "iced", 132 | "iml", 133 | "inc", 134 | "inf", 135 | "info", 136 | "ini", 137 | "ino", 138 | "int", 139 | "irbrc", 140 | "itcl", 141 | "itermcolors", 142 | "itk", 143 | "jade", 144 | "java", 145 | "jhtm", 146 | "jhtml", 147 | "js", 148 | "jscsrc", 149 | "jshintignore", 150 | "jshintrc", 151 | "json", 152 | "json5", 153 | "jsonld", 154 | "jsp", 155 | "jspx", 156 | "jsx", 157 | "ksh", 158 | "less", 159 | "lhs", 160 | "lisp", 161 | "log", 162 | "ls", 163 | "lsp", 164 | "lua", 165 | "m", 166 | "m4", 167 | "mak", 168 | "map", 169 | "markdown", 170 | "master", 171 | "md", 172 | "mdown", 173 | "mdwn", 174 | "mdx", 175 | "metadata", 176 | "mht", 177 | "mhtml", 178 | "mjs", 179 | "mk", 180 | "mkd", 181 | "mkdn", 182 | "mkdown", 183 | "ml", 184 | "mli", 185 | "mm", 186 | "mts", 187 | "mxml", 188 | "nfm", 189 | "nfo", 190 | "noon", 191 | "npmignore", 192 | "npmrc", 193 | "nuspec", 194 | "nvmrc", 195 | "ops", 196 | "pas", 197 | "pasm", 198 | "patch", 199 | "pbxproj", 200 | "pch", 201 | "pem", 202 | "pg", 203 | "php", 204 | "php3", 205 | "php4", 206 | "php5", 207 | "phpt", 208 | "phtml", 209 | "pir", 210 | "pl", 211 | "pm", 212 | "pmc", 213 | "pod", 214 | "pot", 215 | "prettierrc", 216 | "properties", 217 | "props", 218 | "pt", 219 | "pug", 220 | "purs", 221 | "py", 222 | "pyx", 223 | "r", 224 | "rake", 225 | "rb", 226 | "rbw", 227 | "rc", 228 | "rdoc", 229 | "rdoc_options", 230 | "resx", 231 | "rexx", 232 | "rhtml", 233 | "rjs", 234 | "rlib", 235 | "ron", 236 | "rs", 237 | "rss", 238 | "rst", 239 | "rtf", 240 | "rvmrc", 241 | "rxml", 242 | "s", 243 | "sass", 244 | "scala", 245 | "scm", 246 | "scss", 247 | "seestyle", 248 | "sh", 249 | "shtml", 250 | "sln", 251 | "sls", 252 | "spec", 253 | "sql", 254 | "sqlite", 255 | "sqlproj", 256 | "srt", 257 | "ss", 258 | "sss", 259 | "st", 260 | "strings", 261 | "sty", 262 | "styl", 263 | "stylus", 264 | "sub", 265 | "sublime-build", 266 | "sublime-commands", 267 | "sublime-completions", 268 | "sublime-keymap", 269 | "sublime-macro", 270 | "sublime-menu", 271 | "sublime-project", 272 | "sublime-settings", 273 | "sublime-workspace", 274 | "sv", 275 | "svc", 276 | "svg", 277 | "swift", 278 | "t", 279 | "tcl", 280 | "tcsh", 281 | "terminal", 282 | "tex", 283 | "text", 284 | "textile", 285 | "tg", 286 | "tk", 287 | "tmLanguage", 288 | "tmpl", 289 | "tmTheme", 290 | "tpl", 291 | "ts", 292 | "tsv", 293 | "tsx", 294 | "tt", 295 | "tt2", 296 | "ttml", 297 | "twig", 298 | "txt", 299 | "v", 300 | "vb", 301 | "vbproj", 302 | "vbs", 303 | "vcproj", 304 | "vcxproj", 305 | "vh", 306 | "vhd", 307 | "vhdl", 308 | "vim", 309 | "viminfo", 310 | "vimrc", 311 | "vm", 312 | "vue", 313 | "webapp", 314 | "webmanifest", 315 | "wsc", 316 | "x-php", 317 | "xaml", 318 | "xht", 319 | "xhtml", 320 | "xml", 321 | "xs", 322 | "xsd", 323 | "xsl", 324 | "xslt", 325 | "y", 326 | "yaml", 327 | "yml", 328 | "zsh", 329 | "zshrc" 330 | ] 331 | --------------------------------------------------------------------------------