-
Notifications
You must be signed in to change notification settings - Fork 280
Expand file tree
/
Copy pathutils.file.file.html
More file actions
39 lines (39 loc) · 4.1 KB
/
Copy pathutils.file.file.html
File metadata and controls
39 lines (39 loc) · 4.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<a href="https://github.com/socketstream/socketstream/edit/master/lib/utils/file.js" class="improve-docs"><i class="icon-edit"> </i>Improve this doc</a><a href="https://github.com/socketstream/socketstream/blob/796fa06/lib/utils/file.js#L20" class="view-source"><i class="icon-eye-open"> </i>View source</a><h1><code ng:non-bindable="">file</code>
<div><span class="hint">service in module <code ng:non-bindable="">utils</code>
</span>
</div>
</h1>
<div><h2 id="description">Description</h2>
<div class="description"><div class="utils-file-page utils-file-file-page"><p>This is used to maintain lists of userIds to socketIds and channelIds to socketIds</p>
</div></div>
<div class="member method"><h2 id="methods">Methods</h2>
<ul class="methods"><li><a href="https://github.com/socketstream/socketstream/blob/796fa06/lib/utils/file.js#L169" class="view-source icon-eye-open"> </a><h3 id="methods_findextforbasepath">findExtForBasePath(basepath)</h3>
<div class="findextforbasepath"><div class="utils-file-findextforbasepath-page"><p>Given a basename, find a matching file with an extension.</p>
</div><h5 id="methods_findextforbasepath_parameters">Parameters</h5><table class="variables-matrix table table-bordered table-striped"><thead><tr><th>Param</th><th>Type</th><th>Details</th></tr></thead><tbody><tr><td>basepath</td><td><a href="" class="label type-hint type-hint-object">Object</a></td><td><div class="utils-file-findextforbasepath-page"><p>Path to directory</p>
</div></td></tr></tbody></table><h5 id="methods_findextforbasepath_returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-array">Array|null</a></td><td><div class="utils-file-findextforbasepath-page"><p>Array of files or <code>null</code></p>
</div></td></tr></table><h4 id="methods_findextforbasepath_example">Example</h4>
<div class="example"><div class="utils-file-findextforbasepath-page"><pre class="prettyprint linenums">
findExtForBase('views/main') => '.jade'
findExtForBase('css/i-dont-exist') => null
</pre>
</div></div>
</div>
</li>
<li><a href="https://github.com/socketstream/socketstream/blob/796fa06/lib/utils/file.js#L147" class="view-source icon-eye-open"> </a><h3 id="methods_isdir">isDir()</h3>
<div class="isdir"><div class="utils-file-isdir-page"><p>In synchronous mode returns if givven <code>filePath</code> is directory or not</p>
</div><h5 id="methods_isdir_returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-boolean">Boolean</a></td><td><div class="utils-file-isdir-page"><p>TRUE if givven <code>filePath</code> is dorectory</p>
</div></td></tr></table></div>
</li>
<li><a href="https://github.com/socketstream/socketstream/blob/796fa06/lib/utils/file.js#L128" class="view-source icon-eye-open"> </a><h3 id="methods_loadpackagejson">loadPackageJSON()</h3>
<div class="loadpackagejson"><div class="utils-file-loadpackagejson-page"><p>Loads SocketStream's package.json file from the root directory</p>
</div><h5 id="methods_loadpackagejson_returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-object">Object|Error</a></td><td><div class="utils-file-loadpackagejson-page"><p>JSON object or thorws an eror if unable to find or parse SocketStream's package.json file</p>
</div></td></tr></table></div>
</li>
<li><a href="https://github.com/socketstream/socketstream/blob/796fa06/lib/utils/file.js#L82" class="view-source icon-eye-open"> </a><h3 id="methods_readdirsync">readDirSync(start)</h3>
<div class="readdirsync"><div class="utils-file-readdirsync-page"><p>Reads the contents of a dir. Adapted from <a href="https://gist.github.com/825583">https://gist.github.com/825583</a></p>
</div><h5 id="methods_readdirsync_parameters">Parameters</h5><table class="variables-matrix table table-bordered table-striped"><thead><tr><th>Param</th><th>Type</th><th>Details</th></tr></thead><tbody><tr><td>start</td><td><a href="" class="label type-hint type-hint-string">String</a></td><td><div class="utils-file-readdirsync-page"><p>Directory absolute path to lookup</p>
</div></td></tr></tbody></table></div>
</li>
</ul>
</div>
</div>