pax_global_header00006660000000000000000000000064127662350270014524gustar00rootroot0000000000000052 comment=f6e9ccf93e55a46616d46d19967b923a2c135ecd is-binary-path-2.0.0/000077500000000000000000000000001276623502700143525ustar00rootroot00000000000000is-binary-path-2.0.0/.editorconfig000066400000000000000000000002761276623502700170340ustar00rootroot00000000000000root = true [*] indent_style = tab end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [{package.json,*.yml}] indent_style = space indent_size = 2 is-binary-path-2.0.0/.gitattributes000066400000000000000000000000141276623502700172400ustar00rootroot00000000000000* text=auto is-binary-path-2.0.0/.gitignore000066400000000000000000000000151276623502700163360ustar00rootroot00000000000000node_modules is-binary-path-2.0.0/.travis.yml000066400000000000000000000000671276623502700164660ustar00rootroot00000000000000sudo: false language: node_js node_js: - '6' - '4' is-binary-path-2.0.0/index.js000066400000000000000000000003431276623502700160170ustar00rootroot00000000000000'use strict'; const path = require('path'); const binaryExtensions = require('binary-extensions'); const exts = new Set(binaryExtensions); module.exports = filepath => exts.has(path.extname(filepath).slice(1).toLowerCase()); is-binary-path-2.0.0/license000066400000000000000000000021371276623502700157220ustar00rootroot00000000000000The MIT License (MIT) Copyright (c) Sindre Sorhus (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: 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. is-binary-path-2.0.0/package.json000066400000000000000000000013101276623502700166330ustar00rootroot00000000000000{ "name": "is-binary-path", "version": "2.0.0", "description": "Check if a filepath is a binary file", "license": "MIT", "repository": "sindresorhus/is-binary-path", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=4" }, "scripts": { "test": "xo && ava" }, "files": [ "index.js" ], "keywords": [ "bin", "binary", "ext", "extensions", "extension", "file", "path", "check", "detect", "is" ], "dependencies": { "binary-extensions": "^1.0.0" }, "devDependencies": { "ava": "*", "xo": "*" }, "xo": { "esnext": true } } is-binary-path-2.0.0/readme.md000066400000000000000000000012671276623502700161370ustar00rootroot00000000000000# is-binary-path [![Build Status](https://travis-ci.org/sindresorhus/is-binary-path.svg?branch=master)](https://travis-ci.org/sindresorhus/is-binary-path) > Check if a filepath is a binary file ## Install ``` $ npm install --save is-binary-path ``` ## Usage ```js const isBinaryPath = require('is-binary-path'); isBinaryPath('src/unicorn.png'); //=> true isBinaryPath('src/unicorn.txt'); //=> false ``` ## Related - [binary-extensions](https://github.com/sindresorhus/binary-extensions) - List of binary file extensions - [is-text-path](https://github.com/sindresorhus/is-text-path) - Check if a filepath is a text file ## License MIT © [Sindre Sorhus](https://sindresorhus.com) is-binary-path-2.0.0/test.js000066400000000000000000000003051276623502700156650ustar00rootroot00000000000000import test from 'ava'; import m from './'; test(t => { t.true(m('unicorn.png')); t.true(m('unicorn.zip')); t.true(m('unicorn.ZIP')); t.false(m('unicornzip')); t.false(m('unicorn.txt')); });