...
 
Commits (4)
node_modules/.cache/*
node_modules/.cache/
dist/*
*.swp
/*! normalize.css v1.1.3 | MIT License | git.io/normalize */article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}audio:not([controls]){display:none;height:0}[hidden]{display:none}html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;font-size:100%}button,html,input,select,textarea{font-family:sans-serif}body{margin:0}a:focus{outline:thin dotted}a:active,a:hover{outline:0}h1{font-size:2em;margin:.67em 0}h2{font-size:1.5em;margin:.83em 0}h3{font-size:1.17em;margin:1em 0}h4{font-size:1em;margin:1.33em 0}h5{font-size:.83em;margin:1.67em 0}h6{font-size:.67em;margin:2.33em 0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}blockquote{margin:1em 40px}dfn{font-style:italic}hr{-webkit-box-sizing:content-box;box-sizing:content-box;height:0}mark{background:#ff0;color:#000}p,pre{margin:1em 0}code,kbd,pre,samp{font-family:monospace,serif;_font-family:courier new,monospace;font-size:1em}pre{white-space:pre;white-space:pre-wrap;word-wrap:break-word}q{quotes:none}q:after,q:before{content:"";content:none}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}dl,menu,ol,ul{margin:1em 0}dd{margin:0 0 0 40px}menu,ol,ul{padding:0 0 0 40px}nav ol,nav ul{list-style:none;list-style-image:none}img{-ms-interpolation-mode:bicubic;border:0}svg:not(:root){overflow:hidden}figure,form{margin:0}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;*margin-left:-7px;padding:0;white-space:normal}button,input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}button,input{line-height:normal}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer;*overflow:visible}button[disabled],html input[disabled]{cursor:default}input[type=checkbox],input[type=radio]{-webkit-box-sizing:border-box;box-sizing:border-box;*height:13px;padding:0;*width:13px}input[type=search]{-webkit-appearance:textfield;-webkit-box-sizing:content-box;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}textarea{overflow:auto;vertical-align:top}table{border-collapse:collapse;border-spacing:0}
/*! HTML5 Boilerplate v4.3.0 | MIT License | http://h5bp.com/ */button,html,input,select,textarea{color:#222}html{font-size:1em;line-height:1.4}::-moz-selection{background:#b3d4fc;text-shadow:none}::selection{background:#b3d4fc;text-shadow:none}hr{border:0;border-top:1px solid #ccc;display:block;height:1px;margin:1em 0;padding:0}audio,canvas,img,video{vertical-align:middle}fieldset{border:0;margin:0;padding:0}textarea{resize:vertical}.browsehappy{background:#ccc;color:#000;margin:.2em 0;padding:.2em 0}body{font:18px Helvetica Neue,Arial,Helvetica,Geneva,sans-serif;line-height:22px;padding:1em}main{max-width:635px}h3.hello{background-color:#809bac;padding:10px}.register,.signin{background-color:#bcdfda;border-radius:10px;border-right:30px solid grey;margin:20px;padding:20px;width:200px}#spatialui{margin-bottom:30px;width:600px}#spatialui,button{background-color:#bcdfda}button{-webkit-box-shadow:none;border:none;box-shadow:none;margin-left:65%;margin-top:10px}button:hover{color:grey}input{border:none;margin-bottom:5px;padding:5px;width:100%}.ir{background-color:transparent;border:0;overflow:hidden;*text-indent:-9999px}.ir:before{content:"";display:block;height:150%;width:0}.hidden{display:none!important;visibility:hidden}.visuallyhidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.visuallyhidden.focusable:active,.visuallyhidden.focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto}.invisible{visibility:hidden}.clearfix:after,.clearfix:before{content:" ";display:table}.clearfix:after{clear:both}.clearfix{*zoom:1}@media only screen and (min-width:640px){#start{display:grid;grid-gap:20px;grid-template-columns:300px 300px}}@media print{*{-webkit-box-shadow:none!important;background:transparent!important;box-shadow:none!important;color:#000!important;text-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="#"]:after,a[href^="javascript:"]:after{content:""}blockquote,pre{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}img{max-width:100%!important}@page{margin:.5cm}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}}
\ No newline at end of file
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=/favicon.ico><title>nn2</title><link href=/css/home.5e776665.css rel=prefetch><link href=/js/about.533ecf76.js rel=prefetch><link href=/js/home.ad1a20b9.js rel=prefetch><link href=/css/app.1dfce210.css rel=preload as=style><link href=/js/app.95658898.js rel=preload as=script><link href=/js/chunk-vendors.e8395ff3.js rel=preload as=script><link href=/css/app.1dfce210.css rel=stylesheet></head><body><noscript><strong>We're sorry but nn2 doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div></body></html><script src=/js/chunk-vendors.e8395ff3.js></script><script src=/js/app.95658898.js></script>
\ No newline at end of file
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["about"],{"754b":function(e,t,n){"use strict";n.r(t);var r=function(){var e=this,t=e.$createElement;e._self._c;return e._m(0)},o=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("footer",[n("p",[e._v("Made by Procter & Parker")])])}],u=n("2877"),a={},c=Object(u["a"])(a,r,o,!1,null,null,null);c.options.__file="about.vue";t["default"]=c.exports}}]);
//# sourceMappingURL=about.533ecf76.js.map
\ No newline at end of file
{"version":3,"sources":["webpack:///./src/views/about.vue?f2d3","webpack:///./src/views/about.vue"],"names":["render","_vm","this","_h","$createElement","_self","_c","_m","staticRenderFns","_v","script","component","Object","componentNormalizer","options","__file","__webpack_exports__"],"mappings":"gHAAA,IAAAA,EAAA,WAA0B,IAAAC,EAAAC,KAAaC,EAAAF,EAAAG,eAA0BH,EAAAI,MAAAC,GAAwB,OAAAL,EAAAM,GAAA,IACzFC,GAAA,WAAoC,IAAAP,EAAAC,KAAaC,EAAAF,EAAAG,eAA0BE,EAAAL,EAAAI,MAAAC,IAAAH,EAAwB,OAAAG,EAAA,UAAAA,EAAA,KAAAL,EAAAQ,GAAA,8CCAnGC,KAKAC,EAAAC,OAAAC,EAAA,KAAAD,CACAF,EACAV,EACAQ,GACA,EACA,KACA,KACA,MAIAG,EAAAG,QAAAC,OAAA,YACAC,EAAA,WAAAL","file":"js/about.533ecf76.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _vm._m(0)}\nvar staticRenderFns = [function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('footer',[_c('p',[_vm._v(\"Made by Procter & Parker\")])])}]\n\nexport { render, staticRenderFns }","import { render, staticRenderFns } from \"./about.vue?vue&type=template&id=e60e8f3a&\"\nvar script = {}\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\ncomponent.options.__file = \"about.vue\"\nexport default component.exports"],"sourceRoot":""}
\ No newline at end of file
(function(e){function t(t){for(var a,i,u=t[0],s=t[1],c=t[2],l=0,m=[];l<u.length;l++)i=u[l],r[i]&&m.push(r[i][0]),r[i]=0;for(a in s)Object.prototype.hasOwnProperty.call(s,a)&&(e[a]=s[a]);f&&f(t);while(m.length)m.shift()();return o.push.apply(o,c||[]),n()}function n(){for(var e,t=0;t<o.length;t++){for(var n=o[t],a=!0,i=1;i<n.length;i++){var u=n[i];0!==r[u]&&(a=!1)}a&&(o.splice(t--,1),e=s(s.s=n[0]))}return e}var a={},i={app:0},r={app:0},o=[];function u(e){return s.p+"js/"+({about:"about",home:"home"}[e]||e)+"."+{about:"533ecf76",home:"ad1a20b9"}[e]+".js"}function s(t){if(a[t])return a[t].exports;var n=a[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,s),n.l=!0,n.exports}s.e=function(e){var t=[],n={home:1};i[e]?t.push(i[e]):0!==i[e]&&n[e]&&t.push(i[e]=new Promise(function(t,n){for(var a="css/"+({about:"about",home:"home"}[e]||e)+"."+{about:"31d6cfe0",home:"5e776665"}[e]+".css",i=s.p+a,r=document.getElementsByTagName("link"),o=0;o<r.length;o++){var u=r[o],c=u.getAttribute("data-href")||u.getAttribute("href");if("stylesheet"===u.rel&&(c===a||c===i))return t()}var l=document.getElementsByTagName("style");for(o=0;o<l.length;o++){u=l[o],c=u.getAttribute("data-href");if(c===a||c===i)return t()}var m=document.createElement("link");m.rel="stylesheet",m.type="text/css",m.onload=t,m.onerror=function(t){var a=t&&t.target&&t.target.src||i,r=new Error("Loading CSS chunk "+e+" failed.\n("+a+")");r.request=a,n(r)},m.href=i;var f=document.getElementsByTagName("head")[0];f.appendChild(m)}).then(function(){i[e]=0}));var a=r[e];if(0!==a)if(a)t.push(a[2]);else{var o=new Promise(function(t,n){a=r[e]=[t,n]});t.push(a[2]=o);var c,l=document.getElementsByTagName("head")[0],m=document.createElement("script");m.charset="utf-8",m.timeout=120,s.nc&&m.setAttribute("nonce",s.nc),m.src=u(e),c=function(t){m.onerror=m.onload=null,clearTimeout(f);var n=r[e];if(0!==n){if(n){var a=t&&("load"===t.type?"missing":t.type),i=t&&t.target&&t.target.src,o=new Error("Loading chunk "+e+" failed.\n("+a+": "+i+")");o.type=a,o.request=i,n[1](o)}r[e]=void 0}};var f=setTimeout(function(){c({type:"timeout",target:m})},12e4);m.onerror=m.onload=c,l.appendChild(m)}return Promise.all(t)},s.m=e,s.c=a,s.d=function(e,t,n){s.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},s.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(s.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)s.d(n,a,function(t){return e[t]}.bind(null,a));return n},s.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="/",s.oe=function(e){throw console.error(e),e};var c=window["webpackJsonp"]=window["webpackJsonp"]||[],l=c.push.bind(c);c.push=t,c=c.slice();for(var m=0;m<c.length;m++)t(c[m]);var f=l;o.push([0,"chunk-vendors"]),n()})({0:function(e,t,n){e.exports=n("56d7")},"1fbb":function(e,t,n){"use strict";var a=n("2e12"),i=n.n(a);i.a},"20a9":function(e,t,n){"use strict";var a=n("8f56"),i=n.n(a);i.a},"2e12":function(e,t,n){},3147:function(e,t,n){"use strict";var a=n("62f4"),i=n.n(a);i.a},"56d7":function(e,t,n){"use strict";n.r(t);n("cadf"),n("551c"),n("097d");var a=n("2b0e"),i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("main",[n("nav",[n("ul",[n("li",[e.authenticated?n("router-link",{attrs:{to:"/",replace:""},nativeOn:{click:function(t){e.signout()}}},[e._v("Sign Out")]):e._e()],1),n("li",[e.authenticated?n("router-link",{attrs:{to:"/home"}},[e._v("Home")]):e._e()],1),n("li",[e.authenticated?n("router-link",{attrs:{to:"/about"}},[e._v("About")]):e._e()],1)])]),n("router-view",{on:{authenticated:e.setAuthenticated}})],1)},r=[],o=(n("a481"),{name:"auth",data:function(){return{authenticated:!1}},mounted:function(){this.authenticated||this.$router.replace({name:"start"})},methods:{setAuthenticated:function(e){this.authenticated=e},signout:function(){this.authenticated=!1}}}),u=o,s=(n("1fbb"),n("3147"),n("2877")),c=Object(s["a"])(u,i,r,!1,null,null,null);c.options.__file="App.vue";var l=c.exports,m=n("8c4f"),f=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("header",[n("h3",{staticClass:"hello"},[e._v("You are connected to instance : "+e._s(e.instancename))])]),n("div",{attrs:{id:"start"}},[n("signin",{attrs:{instancename:e.instancename}}),n("register")],1)])},p=[],d=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("section",{staticClass:"signin"},[n("h1",[e._v("Sign in")]),n("input",{directives:[{name:"model",rawName:"v-model",value:e.input.email,expression:"input.email"}],attrs:{type:"text",name:"email",placeholder:"Email"},domProps:{value:e.input.email},on:{input:function(t){t.target.composing||e.$set(e.input,"email",t.target.value)}}}),n("button",{attrs:{type:"submit"},on:{click:function(t){e.signin()}}},[n("font-awesome-icon",{attrs:{icon:"sign-in-alt",size:"3x"}})],1)])},h=[],v={name:"signin",data:function(){return{input:{email:""}}},props:{instancename:String},methods:{signin:function(){""!=this.input.email?this.input.email==this.$parent.account.email?(this.$parent.$emit("authenticated",!0),this.$router.replace({name:"home"})):alert("The email is incorrect"):alert("A email must be present")}}},g=v,b=(n("8a93"),Object(s["a"])(g,d,h,!1,null,"075875f8",null));b.options.__file="signin.vue";var y=b.exports,_=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("section",{staticClass:"register"},[n("h1",[e._v("Register")]),n("input",{directives:[{name:"model",rawName:"v-model",value:e.name,expression:"name"}],attrs:{type:"text",name:"name",placeholder:"Name"},domProps:{value:e.name},on:{input:function(t){t.target.composing||(e.name=t.target.value)}}}),n("input",{directives:[{name:"model",rawName:"v-model",value:e.email,expression:"email"}],attrs:{type:"text",name:"email",placeholder:"Email"},domProps:{value:e.email},on:{input:function(t){t.target.composing||(e.email=t.target.value)}}}),n("input",{directives:[{name:"model",rawName:"v-model",value:e.domain,expression:"domain"}],attrs:{type:"text",name:"domain",placeholder:"Domain"},domProps:{value:e.domain},on:{input:function(t){t.target.composing||(e.domain=t.target.value)}}}),n("button",{attrs:{type:"submit"},on:{click:function(t){e.register()}}},[n("font-awesome-icon",{attrs:{icon:"user-plus",size:"3x"}})],1)])},w=[],x=(n("7f7f"),n("6b54"),n("16b2")),k=new x["a"]("https://nn.adamprocter.co.uk/testingdb"),O={name:"register",data:function(){return{name:"",email:"",domain:"",permissions:1,verified:!1}},mounted:function(){this.checkData()},methods:{register:function(){var e=Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15);k.put({_id:e,name:this.name,email:this.email,domain:this.domain,permissions:this.permissions,verified:this.verified})},checkData:function(){k.info().then(function(e){console.log(e)}),k.allDocs({include_docs:!0,attachments:!0}).then(function(e){console.log(e)}).catch(function(e){console.log(e)})}}},j=O,E=(n("9183"),Object(s["a"])(j,_,w,!1,null,"f622846c",null));E.options.__file="register.vue";var P=E.exports,S={name:"app",components:{signin:y,register:P},data:function(){return{instancename:"mozfest",account:{id:1,human:"adam procter",email:"adamprocter@researchnot.es",permissions:1}}}},$=S,A=(n("20a9"),Object(s["a"])($,f,p,!1,null,"c7241f6c",null));A.options.__file="start.vue";var T=A.exports;a["a"].use(m["a"]);var N=new m["a"]({routes:[{path:"/",name:"start",component:T},{path:"/home",name:"home",component:function(){return n.e("home").then(n.bind(null,"6511"))}},{path:"/about",name:"about",component:function(){return n.e("about").then(n.bind(null,"754b"))}}]}),C=n("ecee"),M=n("c074"),B=n("7a55");C["library"].add(M["a"]),C["library"].add(M["b"]),a["a"].component("font-awesome-icon",B["FontAwesomeIcon"]),a["a"].config.productionTip=!1,new a["a"]({router:N,render:function(e){return e(l)}}).$mount("#app"),n("6909")},"62f4":function(e,t,n){},6909:function(e,t,n){"use strict";n.r(t);n("cadf"),n("551c"),n("097d")},"6a10":function(e,t,n){},"8a93":function(e,t,n){"use strict";var a=n("8d4b"),i=n.n(a);i.a},"8d4b":function(e,t,n){},"8f56":function(e,t,n){},9183:function(e,t,n){"use strict";var a=n("6a10"),i=n.n(a);i.a}});
//# sourceMappingURL=app.95658898.js.map
\ No newline at end of file
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
../needle/bin/needle
\ No newline at end of file
../node-pre-gyp/bin/node-pre-gyp
\ No newline at end of file
../nopt/bin/nopt.js
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This software is dual-licensed under the ISC and MIT licenses.
You may use this software under EITHER of the following licenses.
----------
The ISC License
Copyright (c) Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
----------
Copyright Isaac Z. Schlueter and Contributors
All rights reserved.
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.
# abbrev-js
Just like [ruby's Abbrev](http://apidock.com/ruby/Abbrev).
Usage:
var abbrev = require("abbrev");
abbrev("foo", "fool", "folding", "flop");
// returns:
{ fl: 'flop'
, flo: 'flop'
, flop: 'flop'
, fol: 'folding'
, fold: 'folding'
, foldi: 'folding'
, foldin: 'folding'
, folding: 'folding'
, foo: 'foo'
, fool: 'fool'
}
This is handy for command-line scripts, or other cases where you want to be able to accept shorthands.
module.exports = exports = abbrev.abbrev = abbrev
abbrev.monkeyPatch = monkeyPatch
function monkeyPatch () {
Object.defineProperty(Array.prototype, 'abbrev', {
value: function () { return abbrev(this) },
enumerable: false, configurable: true, writable: true
})
Object.defineProperty(Object.prototype, 'abbrev', {
value: function () { return abbrev(Object.keys(this)) },
enumerable: false, configurable: true, writable: true
})
}
function abbrev (list) {
if (arguments.length !== 1 || !Array.isArray(list)) {
list = Array.prototype.slice.call(arguments, 0)
}
for (var i = 0, l = list.length, args = [] ; i < l ; i ++) {
args[i] = typeof list[i] === "string" ? list[i] : String(list[i])
}
// sort them lexicographically, so that they're next to their nearest kin
args = args.sort(lexSort)
// walk through each, seeing how much it has in common with the next and previous
var abbrevs = {}
, prev = ""
for (var i = 0, l = args.length ; i < l ; i ++) {
var current = args[i]
, next = args[i + 1] || ""
, nextMatches = true
, prevMatches = true
if (current === next) continue
for (var j = 0, cl = current.length ; j < cl ; j ++) {
var curChar = current.charAt(j)
nextMatches = nextMatches && curChar === next.charAt(j)
prevMatches = prevMatches && curChar === prev.charAt(j)
if (!nextMatches && !prevMatches) {
j ++
break
}
}
prev = current
if (j === cl) {
abbrevs[current] = current
continue
}
for (var a = current.substr(0, j) ; j <= cl ; j ++) {
abbrevs[a] = current
a += current.charAt(j)
}
}
return abbrevs
}
function lexSort (a, b) {
return a === b ? 0 : a > b ? 1 : -1
}
{
"name": "abbrev",
"version": "1.1.1",
"description": "Like ruby's abbrev module, but in js",
"author": "Isaac Z. Schlueter <i@izs.me>",
"main": "abbrev.js",
"scripts": {
"test": "tap test.js --100",
"preversion": "npm test",
"postversion": "npm publish",
"postpublish": "git push origin --all; git push origin --tags"
},
"repository": "http://github.com/isaacs/abbrev-js",
"license": "ISC",
"devDependencies": {
"tap": "^10.1"
},
"files": [
"abbrev.js"
]
}
......@@ -71,11 +71,6 @@ Note that the origin is _1, 1_ not _0, 0_.
Returns the escape sequence to move the cursor to the beginning of the
current line. (That is, it returns a carriage return, `\r`.)
### var code = consoleControl.beep()
Returns the escape sequence to cause the termianl to beep. (That is, it
returns unicode character `\x0007`, a Control-G.)
### var code = consoleControl.hideCursor()
Returns the escape sequence to hide the cursor.
......
The ISC License
Copyright (c) Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
# fs-minipass
Filesystem streams based on [minipass](http://npm.im/minipass).
4 classes are exported:
- ReadStream
- ReadStreamSync
- WriteStream
- WriteStreamSync
When using `ReadStreamSync`, all of the data is made available
immediately upon consuming the stream. Nothing is buffered in memory
when the stream is constructed. If the stream is piped to a writer,
then it will synchronously `read()` and emit data into the writer as
fast as the writer can consume it. (That is, it will respect
backpressure.) If you call `stream.read()` then it will read the
entire file and return the contents.
When using `WriteStreamSync`, every write is flushed to the file
synchronously. If your writes all come in a single tick, then it'll
write it all out in a single tick. It's as synchronous as you are.
The async versions work much like their node builtin counterparts,
with the exception of introducing significantly less Stream machinery
overhead.
## USAGE
It's just streams, you pipe them or read() them or write() to them.
```js
const fsm = require('fs-minipass')
const readStream = new fsm.ReadStream('file.txt')
const writeStream = new fsm.WriteStream('output.txt')
writeStream.write('some file header or whatever\n')
readStream.pipe(writeStream)
```
## ReadStream(path, options)
Path string is required, but somewhat irrelevant if an open file
descriptor is passed in as an option.
Options:
- `fd` Pass in a numeric file descriptor, if the file is already open.
- `readSize` The size of reads to do, defaults to 16MB
- `size` The size of the file, if known. Prevents zero-byte read()
call at the end.
- `autoClose` Set to `false` to prevent the file descriptor from being
closed when the file is done being read.
## WriteStream(path, options)
Path string is required, but somewhat irrelevant if an open file
descriptor is passed in as an option.
Options:
- `fd` Pass in a numeric file descriptor, if the file is already open.
- `mode` The mode to create the file with. Defaults to `0o666`.
- `start` The position in the file to start reading. If not
specified, then the file will start writing at position zero, and be
truncated by default.
- `autoClose` Set to `false` to prevent the file descriptor from being
closed when the stream is ended.
- `flags` Flags to use when opening the file. Irrelevant if `fd` is
passed in, since file won't be opened in that case. Defaults to
`'a'` if a `pos` is specified, or `'w'` otherwise.
'use strict'
const MiniPass = require('minipass')
const EE = require('events').EventEmitter
const fs = require('fs')
// for writev
const binding = process.binding('fs')
const writeBuffers = binding.writeBuffers
const FSReqWrap = binding.FSReqWrap
const _autoClose = Symbol('_autoClose')
const _close = Symbol('_close')
const _ended = Symbol('_ended')
const _fd = Symbol('_fd')
const _finished = Symbol('_finished')
const _flags = Symbol('_flags')
const _flush = Symbol('_flush')
const _handleChunk = Symbol('_handleChunk')
const _makeBuf = Symbol('_makeBuf')
const _mode = Symbol('_mode')
const _needDrain = Symbol('_needDrain')
const _onerror = Symbol('_onerror')
const _onopen = Symbol('_onopen')
const _onread = Symbol('_onread')
const _onwrite = Symbol('_onwrite')
const _open = Symbol('_open')
const _path = Symbol('_path')
const _pos = Symbol('_pos')
const _queue = Symbol('_queue')
const _read = Symbol('_read')
const _readSize = Symbol('_readSize')
const _reading = Symbol('_reading')
const _remain = Symbol('_remain')
const _size = Symbol('_size')
const _write = Symbol('_write')
const _writing = Symbol('_writing')
const _defaultFlag = Symbol('_defaultFlag')
class ReadStream extends MiniPass {
constructor (path, opt) {
opt = opt || {}
super(opt)
this.writable = false
if (typeof path !== 'string')
throw new TypeError('path must be a string')
this[_fd] = typeof opt.fd === 'number' ? opt.fd : null
this[_path] = path
this[_readSize] = opt.readSize || 16*1024*1024
this[_reading] = false
this[_size] = typeof opt.size === 'number' ? opt.size : Infinity
this[_remain] = this[_size]
this[_autoClose] = typeof opt.autoClose === 'boolean' ?
opt.autoClose : true
if (typeof this[_fd] === 'number')
this[_read]()
else
this[_open]()
}
get fd () { return this[_fd] }
get path () { return this[_path] }
write () {
throw new TypeError('this is a readable stream')
}
end () {
throw new TypeError('this is a readable stream')
}
[_open] () {
fs.open(this[_path], 'r', (er, fd) => this[_onopen](er, fd))
}
[_onopen] (er, fd) {