<!doctype html>
<html>
<head>
<meta charset='utf-8' />
<title> | Documentation</title>
<meta name='viewport' content='width=device-width,initial-scale=1'>
<link href='assets/bass.css' type='text/css' rel='stylesheet' />
<link href='assets/style.css' type='text/css' rel='stylesheet' />
<link href='assets/github.css' type='text/css' rel='stylesheet' />
</head>
<body class='documentation'>
<div class='container'>
<div class='clearfix md-mxn2'>
<div class='fixed md-show fix-3 overflow-auto max-height-100'>
<div class='py1 px2'>
<h3 class='mb0 no-anchor'></h3>
<div class='mb1'><code></code></div>
<input
placeholder='Filter'
id='filter-input'
class='col12 block field'
type='text' />
<div id='toc'>
<a
href='#getEncoding'
class='block bold'>
getEncoding
</a>
<a
href='#getEncodingSync'
class='block bold'>
getEncodingSync
</a>
<a
href='#isBinary'
class='block bold'>
isBinary
</a>
<a
href='#isBinarySync'
class='block bold'>
isBinarySync
</a>
<a
href='#isText'
class='block bold'>
isText
</a>
<a
href='#isTextSync'
class='block bold'>
isTextSync
</a>
</div>
</div>
</div>
<div class='fix-margin-3'>
<div class='px2'>
<div class='py1'><section class='py2 clearfix'>
<h2 id='getEncoding' class='mt0'>
getEncoding<span class='gray'>(buffer, opts, next)</span>
</h2>
<p><a href='https://github.com/bevry/istextorbinary/blob/c51e4dfcafa01895636ce821d080e1ce7bcc9452/./source/index.js#L161-L170'><code>./source/index.js</code></a></p>
<p>Get the encoding of a buffer
Uses <code>getEncodingSync</code> behind the scenes.</p>
<h4>Parameters</h4>
<ul class='suppress-p-margin'>
<li><a href="https://nodejs.org/api/buffer.html">Buffer</a>
<strong>buffer</strong>
:
<div class='force-inline'>
<p>forwarded to <code>getEncodingSync</code></p>
</div>
</li>
<li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>
<strong>opts</strong>
:
<div class='force-inline'>
<p>forwarded to <code>getEncodingSync</code></p>
</div>
</li>
<li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function">Function</a>
<strong>next</strong>
:
<div class='force-inline'>
<p>accepts arguments: (error: Error, result: Boolean)</p>
</div>
</li>
</ul>
<h4>Returns</h4>
<code>nothing
</code>
<div class='force-inline'>
</div>
</section>
</div><div class='py1'><section class='py2 clearfix'>
<h2 id='getEncodingSync' class='mt0'>
getEncodingSync<span class='gray'>(buffer, [opts])</span>
</h2>
<p><a href='https://github.com/bevry/istextorbinary/blob/c51e4dfcafa01895636ce821d080e1ce7bcc9452/./source/index.js#L105-L151'><code>./source/index.js</code></a></p>
<p>Get the encoding of a buffer.
We fetch a bunch chars from the start, middle and end of the buffer.
We check all three, as doing only start was not enough, and doing only middle was not enough, so better safe than sorry.</p>
<h4>Parameters</h4>
<ul class='suppress-p-margin'>
<li><a href="https://nodejs.org/api/buffer.html">Buffer</a>
<strong>buffer</strong>
:
<div class='force-inline'>
</div>
</li>
<li>?
<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>
=
<strong>opts</strong>
:
<div class='force-inline'>
</div>
<ul>
<li>?
<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>
=
opts.chunkLength
(default <code>24</code>)
</li>
<li>?
<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>
=
opts.chunkBegin
(default <code>0</code>)
</li>
</ul>
</li>
</ul>
<h4>Returns</h4>
<code>(
<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error">Error</a>
|
<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>
)
</code>
:
<div class='force-inline'>
<p>either an Error instance if something went wrong, or if successful "utf8" or "binary"</p>
</div>
</section>
</div><div class='py1'><section class='py2 clearfix'>
<h2 id='isBinary' class='mt0'>
isBinary<span class='gray'>(filename, buffer, next)</span>
</h2>
<p><a href='https://github.com/bevry/istextorbinary/blob/c51e4dfcafa01895636ce821d080e1ce7bcc9452/./source/index.js#L87-L93'><code>./source/index.js</code></a></p>
<p>Is Binary
Uses <code>isText</code> behind the scenes.</p>
<h4>Parameters</h4>
<ul class='suppress-p-margin'>
<li>?
<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>
<strong>filename</strong>
:
<div class='force-inline'>
<p>forwarded to <code>isText</code></p>
</div>
</li>
<li>?
<a href="https://nodejs.org/api/buffer.html">Buffer</a>
<strong>buffer</strong>
:
<div class='force-inline'>
<p>forwarded to <code>isText</code></p>
</div>
</li>
<li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function">Function</a>
<strong>next</strong>
:
<div class='force-inline'>
<p>accepts arguments: (error: Error, result: Boolean)</p>
</div>
</li>
</ul>
<h4>Returns</h4>
<code>nothing
</code>
<div class='force-inline'>
</div>
</section>
</div><div class='py1'><section class='py2 clearfix'>
<h2 id='isBinarySync' class='mt0'>
isBinarySync<span class='gray'>(filename, buffer)</span>
</h2>
<p><a href='https://github.com/bevry/istextorbinary/blob/c51e4dfcafa01895636ce821d080e1ce7bcc9452/./source/index.js#L73-L77'><code>./source/index.js</code></a></p>
<p>Is Binary (Synchronous)
Uses <code>isTextSync</code> behind the scenes.</p>
<h4>Parameters</h4>
<ul class='suppress-p-margin'>
<li>?
<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>
<strong>filename</strong>
:
<div class='force-inline'>
<p>forwarded to <code>isTextSync</code></p>
</div>
</li>
<li>?
<a href="https://nodejs.org/api/buffer.html">Buffer</a>
<strong>buffer</strong>
:
<div class='force-inline'>
<p>forwarded to <code>isTextSync</code></p>
</div>
</li>
</ul>
<h4>Returns</h4>
<code>(
<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error">Error</a>
|
<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>
)
</code>
<div class='force-inline'>
</div>
</section>
</div><div class='py1'><section class='py2 clearfix'>
<h2 id='isText' class='mt0'>
isText<span class='gray'>(filename, buffer, next)</span>
</h2>
<p><a href='https://github.com/bevry/istextorbinary/blob/c51e4dfcafa01895636ce821d080e1ce7bcc9452/./source/index.js#L56-L64'><code>./source/index.js</code></a></p>
<p>Is Text
Uses <code>isTextSync</code> behind the scenes.</p>
<h4>Parameters</h4>
<ul class='suppress-p-margin'>
<li>?
<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>
<strong>filename</strong>
:
<div class='force-inline'>
<p>forwarded to <code>isTextSync</code></p>
</div>
</li>
<li>?
<a href="https://nodejs.org/api/buffer.html">Buffer</a>
<strong>buffer</strong>
:
<div class='force-inline'>
<p>forwarded to <code>isTextSync</code></p>
</div>
</li>
<li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function">Function</a>
<strong>next</strong>
:
<div class='force-inline'>
<p>accepts arguments: (error: Error, result: Boolean)</p>
</div>
</li>
</ul>
<h4>Returns</h4>
<code>nothing
</code>
<div class='force-inline'>
</div>
</section>
</div><div class='py1'><section class='py2 clearfix'>
<h2 id='isTextSync' class='mt0'>
isTextSync<span class='gray'>(filename, buffer)</span>
</h2>
<p><a href='https://github.com/bevry/istextorbinary/blob/c51e4dfcafa01895636ce821d080e1ce7bcc9452/./source/index.js#L17-L46'><code>./source/index.js</code></a></p>
<p>Is Text (Synchronous)
Determine whether or not a file is a text or binary file.
Determined by extension checks first, then if unknown extension, will fallback on encoding detection.
We do that as encoding detection cannot guarantee everything, especially for chars between utf8 and utf16</p>
<h4>Parameters</h4>
<ul class='suppress-p-margin'>
<li>?
<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>
<strong>filename</strong>
:
<div class='force-inline'>
<p>the filename for the file/buffer if available</p>
</div>
</li>
<li>?
<a href="https://nodejs.org/api/buffer.html">Buffer</a>
<strong>buffer</strong>
:
<div class='force-inline'>
<p>the buffer for the file if available</p>
</div>
</li>
</ul>
<h4>Returns</h4>
<code>(
<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error">Error</a>
|
<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>
)
</code>
<div class='force-inline'>
</div>
</section>
</div>
</div>
</div>
</div>
</div>
<script src='assets/anchor.js'></script>
<script src='assets/site.js'></script>
</body>
</html>
# |
Change |
User |
Description |
Committed |
|
#1
|
23539 |
jenbottom |
Adding the basic code for ember test appk, created with 'ember new' command |
|
|