UNPKG

harrogateclient

Version:

A simple node.js client for Kipr Harrogate on their Wallaby's.

822 lines (204 loc) • 8.74 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JSDoc: Class: File</title> <script src="scripts/prettify/prettify.js"> </script> <script src="scripts/prettify/lang-css.js"> </script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css"> <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css"> </head> <body> <div id="main"> <h1 class="page-title">Class: File</h1> <section> <header> <h2><span class="attribs"><span class="type-signature"></span></span>File<span class="signature">(name, path, load, del, save)</span><span class="type-signature"></span></h2> </header> <article> <div class="container-overview"> <h4 class="name" id="File"><span class="type-signature"></span>new File<span class="signature">(name, path, load, del, save)</span><span class="type-signature"></span></h4> <div class="description"> Creates a File object. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>name</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">name of the file</td> </tr> <tr> <td class="name"><code>path</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">path to the file</td> </tr> <tr> <td class="name"><code>load</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last">function to load the file</td> </tr> <tr> <td class="name"><code>del</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last">function to delete the file</td> </tr> <tr> <td class="name"><code>save</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last">function to save new content to the file</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="index.js.html">index.js</a>, <a href="index.js.html#line162">line 162</a> </li></ul></dd> </dl> </div> <h3 class="subsection-title">Members</h3> <h4 class="name" id="name"><span class="type-signature"></span>name<span class="type-signature"> :string</span></h4> <div class="description"> name of the file </div> <h5>Type:</h5> <ul> <li> <span class="param-type">string</span> </li> </ul> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="index.js.html">index.js</a>, <a href="index.js.html#line171">line 171</a> </li></ul></dd> </dl> <h4 class="name" id="path"><span class="type-signature"></span>path<span class="type-signature"> :string</span></h4> <div class="description"> path of the file </div> <h5>Type:</h5> <ul> <li> <span class="param-type">string</span> </li> </ul> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="index.js.html">index.js</a>, <a href="index.js.html#line177">line 177</a> </li></ul></dd> </dl> <h3 class="subsection-title">Methods</h3> <h4 class="name" id="delete"><span class="type-signature"></span>delete<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;void, error>}</span></h4> <div class="description"> Deletes the file. </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="index.js.html">index.js</a>, <a href="index.js.html#line191">line 191</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.&lt;void, error></span> </dd> </dl> <h4 class="name" id="load"><span class="type-signature"></span>load<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;string, error>}</span></h4> <div class="description"> Loads the content of the File. </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="index.js.html">index.js</a>, <a href="index.js.html#line184">line 184</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.&lt;string, error></span> </dd> </dl> <h4 class="name" id="save"><span class="type-signature"></span>save<span class="signature">(content)</span><span class="type-signature"> &rarr; {Promise.&lt;void, error>}</span></h4> <div class="description"> Saves content to the file. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>content</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">new content</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="index.js.html">index.js</a>, <a href="index.js.html#line199">line 199</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.&lt;void, error></span> </dd> </dl> </article> </section> </div> <nav> <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="File.html">File</a></li><li><a href="HarrogateClient.html">HarrogateClient</a></li><li><a href="Project.html">Project</a></li><li><a href="ProjectInfo.html">ProjectInfo</a></li><li><a href="User.html">User</a></li></ul> </nav> <br class="clear"> <footer> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Feb 23 2018 14:24:20 GMT+0100 (Mitteleuropäische Zeit) </footer> <script> prettyPrint(); </script> <script src="scripts/linenumber.js"> </script> </body> </html>