New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

fasthr

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fasthr - npm Package Compare versions

Comparing version 1.1.3 to 1.2.0

CHANGELOG.md

4

bin/server.js

@@ -1,2 +0,2 @@

"use strict";var e=require("fastify");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=function(){return(r=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};
"use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var e=t(require("fastify")),n=function(){return(n=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};
/*! *****************************************************************************

@@ -15,2 +15,2 @@ Copyright (c) Microsoft Corporation.

PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */function n(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function c(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,c)}u((n=n.apply(e,t||[])).next())}))}function o(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}var i=t(e).default({logger:!0}),a={dir:process.cwd(),port:3e3,livePort:35729,address:"0.0.0.0"};module.exports=function(e){return n(void 0,void 0,void 0,(function(){var t,c,u,s,l,f;return o(this,(function(p){switch(p.label){case 0:t=r(r({},a),e),c=t.dir,u=t.port,s=t.livePort,l=t.address,i.register(require("fastify-static"),{root:c}),i.addHook("onSend",(function(e,t,r){return n(void 0,void 0,void 0,(function(){var e;return o(this,(function(n){switch(n.label){case 0:return r.filename&&/.html$/.test(r.filename)?(e="",[4,new Promise((function(t){return r.on("data",(function(t){return e+=t})).on("finish",t)}))]):[3,2];case 1:return n.sent(),e=e.replace("</body>","<script>\n document.write('<script src=\"http://' + (location.host || 'localhost').split(':')[0] +\n ':"+s+"/livereload.js?snipver=1\"></' + 'script>')\n <\/script></body>"),t.header("content-length",Buffer.from(e).length),[2,e];case 2:return[2,r]}}))}))})),p.label=1;case 1:return p.trys.push([1,3,,4]),[4,i.listen(u,l)];case 2:return p.sent(),[3,4];case 3:return f=p.sent(),i.log.error(f),process.exit(1),[3,4];case 4:return[2]}}))}))};
***************************************************************************** */function r(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}c((r=r.apply(t,e||[])).next())}))}function o(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}var i={dir:process.cwd(),port:3e3,livePort:35729,address:"0.0.0.0",quiet:!1};module.exports=function(t){return r(void 0,void 0,void 0,(function(){var a,u,c,s,l,f,p,d;return o(this,(function(h){switch(h.label){case 0:a=n(n({},i),t),u=a.dir,c=a.port,s=a.livePort,l=a.address,f=a.quiet,(p=e.default({logger:!f})).register(require("fastify-static"),{root:u}),p.addHook("onSend",(function(t,e,n){return r(void 0,void 0,void 0,(function(){var t;return o(this,(function(r){switch(r.label){case 0:return n.filename&&/.html$/.test(n.filename)?(t="",[4,new Promise((function(e){return n.on("data",(function(e){return t+=e})).on("finish",e)}))]):[3,2];case 1:return r.sent(),t=t.replace("</body>","<script>\n document.write('<script src=\"http://' + (location.host || 'localhost').split(':')[0] +\n ':"+s+"/livereload.js?snipver=1\"></' + 'script>')\n <\/script></body>"),e.header("content-length",Buffer.from(t).length),[2,t];case 2:return[2,n]}}))}))})),h.label=1;case 1:return h.trys.push([1,3,,4]),[4,p.listen(c,l,(function(){console.log("🔥 Fast Hot Reload is running on http://"+l+":"+c)}))];case 2:return h.sent(),[3,4];case 3:return d=h.sent(),p.log.error(d),process.exit(1),[3,4];case 4:return[2]}}))}))};
{
"name": "fasthr",
"version": "1.1.3",
"version": "1.2.0",
"description": "A fast and tiny CLI tool to easily spin up a hot reload http server on the current directory",

@@ -14,3 +14,4 @@ "bin": {

"build": "NODE_ENV=production rollup -c",
"start": "yarn build && NODE_ENV=production node -r dotenv/config ./dist/server.js"
"start": "yarn build && ./bin/fasthr",
"release": "standard-version"
},

@@ -30,3 +31,2 @@ "dependencies": {

"concurrently": "^5.3.0",
"dotenv": "^8.2.0",
"nodemon": "^2.0.6",

@@ -36,2 +36,3 @@ "rollup": "^2.27.1",

"rollup-plugin-typescript2": "^0.27.2",
"standard-version": "^9.3.0",
"ts-node": "^9.0.0",

@@ -38,0 +39,0 @@ "typescript": "^4.1.2"

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc