|
yeah it's an NPM package that has no typings module. Actually looks like I forgot to pass the --save flag when I installed it, so npm install wasn't grabbing the package after cloning the repo Whoops.
|
# ? Sep 27, 2017 01:30 |
|
|
# ? Jun 5, 2024 04:18 |
|
yarn just saves it, no need to pass an extra flag.
|
# ? Sep 27, 2017 01:37 |
|
Yarn is just a faster npm right? That was how it was explained to me by my coworker
|
# ? Sep 27, 2017 01:40 |
|
With new and different bugs.
|
# ? Sep 27, 2017 02:10 |
|
Grump posted:Yarn is just a faster npm right? From Stack Overflow: quote:From the get-go, the Yarn lockfile guarantees that repeatedly running yarn on the same repository results in the same packages. Yarn handles package management more intelligently by using lock files. The latest versions of NPM have also been using lock files, though google tells me that yarn's solution still wins out.
|
# ? Sep 27, 2017 02:12 |
|
The Dark Wind posted:From Stack Overflow: Ironically, Yarn lockfiles depend on the Yarn version. Different yarn version = different lockfile. Having said that, I'm glad that there's competition in the node package manager space.
|
# ? Sep 27, 2017 02:32 |
|
[img-xkcd-standards.png]
|
# ? Sep 27, 2017 04:11 |
|
Anecdotally, yarn didn't work and I had to force install all of my packages more often than it worked at my last job.
|
# ? Sep 28, 2017 18:32 |
I'm playing around trying to get some TypeScript set up in WebStorm, but for some reason it wants me to configure a node executable or something? I don't really care about node, all I want to do is client side TypeScript that I'd like for WebStorm to automatically compile when I press the Go button. Specifically I'm getting the error about Node executable not being configured when I exit configuration and a "Service is not started" when I tell it to compile all. I don't even know what a node executable is or how/where to get one.
|
|
# ? Sep 30, 2017 00:51 |
|
Joda posted:I'm playing around trying to get some TypeScript set up in WebStorm, but for some reason it wants me to configure a node executable or something? I don't really care about node, all I want to do is client side TypeScript that I'd like for WebStorm to automatically compile when I press the Go button. Specifically I'm getting the error about Node executable not being configured when I exit configuration and a "Service is not started" when I tell it to compile all. I don't even know what a node executable is or how/where to get one. Typescript is a Node module, not a self-contained executable. https://nodejs.org/en/download/
|
# ? Sep 30, 2017 00:56 |
Roadie posted:Typescript is a Node module, not a self-contained executable. Oh, thanks. Not sure why WebStorm even talks about a built-in compiler then.
|
|
# ? Sep 30, 2017 01:04 |
|
Joda posted:Oh, thanks. Not sure why WebStorm even talks about a built-in compiler then. In the settings, you can choose between Jetbrains built-in compiler and the typescript language service. You should use the language service
|
# ? Sep 30, 2017 01:20 |
|
What are the best places to host your basic Nodejs app these days? I have been using Bluemix which is great but I'm starting to get a small stack of apps running there and it's becoming no longer cheap, they seem to have disabled "auto sleep" for my less important apps so I'm always racking up gigabyte hours too.
|
# ? Sep 30, 2017 16:14 |
|
Nolgthorn posted:What are the best places to host your basic Nodejs app these days? I have been using Bluemix which is great but I'm starting to get a small stack of apps running there and it's becoming no longer cheap, they seem to have disabled "auto sleep" for my less important apps so I'm always racking up gigabyte hours too. Do you need custom domains? Azure app hosting has a free tier, and a shared tier which is very cheap. Heroku is also an option. Google cloud advertises a free tier but I don't know a lot about it.
|
# ? Sep 30, 2017 16:47 |
|
Yes I need to use my own custom domains, I need SSL, I also have a project coming up that needs to host a (incoming) mail server. I don't know much about the details of receiving mail at a domain if there are special requirements for that. Are there smaller players than Microsoft, Heroku, and Google?
|
# ? Sep 30, 2017 16:54 |
|
Don't host your own email. Use 365 or google apps. Azure app service is very reasonably priced, supports node, custom domains, ssl (even easy le support with an extension), deploy from git, and other features. It's worth checking out. I'm sorry I don't have any other suggestions. Azure is what we use at work, so I'm the most familiar with it.
|
# ? Sep 30, 2017 17:11 |
|
Cool I'll try it out! I don't need my own mail server per say I just need to to be able to receive and read emails, no sending emails, no storing emails, nothing like that. Basically this. https://github.com/Flolagale/mailin Nolgthorn fucked around with this message at 17:23 on Sep 30, 2017 |
# ? Sep 30, 2017 17:21 |
|
You can get a Linode for $5 a month now. Then you just use certbot for your SSL. Redirecting to gmail with a text record is easy too. If bashing out your own linux server is scary I could help you out. I know some neat tricks to terminate SSL for websockets too.
|
# ? Sep 30, 2017 23:56 |
|
Nolgthorn posted:What are the best places to host your basic Nodejs app these days? I have been using Bluemix which is great but I'm starting to get a small stack of apps running there and it's becoming no longer cheap, they seem to have disabled "auto sleep" for my less important apps so I'm always racking up gigabyte hours too. If you want to avoid running your own server stuff, you may want to look at now. The pricing scales badly for lots of individual domains, though.
|
# ? Oct 1, 2017 08:56 |
|
Now looks frighteningly competent. All I need is a regular package.json and it'll deploy my app... I can add domains and it automatically gets decorated with ssl and whoisguard for free. I can generate as many deployments as I want. It's too bad that the free tier open sources your code. That means I can't really try them without using a test app, instead of my actual app. Something is fishy about the competency. What if I manage my own domains ssl certs and whoisguard elsewhere because I'm a tinfoil hatter and want to spend more.
|
# ? Oct 1, 2017 16:20 |
|
I really like Heroku just for their ease of use and the ability to just get poo poo done fast. They get pretty expensive if you need to scale out or need lots of different servers.
|
# ? Oct 1, 2017 16:46 |
|
Edit: nevermind.
huhu fucked around with this message at 18:55 on Oct 1, 2017 |
# ? Oct 1, 2017 18:52 |
|
Running a bunch of nodes is pretty common. It's supposed to be, you can have one for each api concern. Docker is big because of the demand for microservices, something that lets me run a bunch of small stuff would make me feel more future proof.
|
# ? Oct 1, 2017 19:34 |
|
Nolgthorn posted:Running a bunch of nodes is pretty common. Digital Ocean is another option.
|
# ? Oct 1, 2017 20:33 |
|
Oh wow I just realized there's a $7/mo tier on Heroku now. I stopped using them ages ago because it was either free and your app fell asleep and took forever to load, or it was $36/mo. $7/mo for not having to janitor a Linux server is not a bad deal at all. now.sh looks interesting too. I work at an agency and we have over 100 droplets on our digital ocean account, it is hell sometimes.
|
# ? Oct 2, 2017 14:06 |
|
edit: My last question was dumb and for idiots. I have a newer more dumb question. OK so I have a stream of data, that could be inexplicably huge. I am trying to pipe this data to a transform and then pipe it to an output stream. This is all well and good and should provide some decent scalability. But the problem is, I need to do some processing based on the very first line of the stream. I know how to pipe the stream to my transform, but I am not sure how to pullout only the first line and use it for all future line transformations... Also what is the boundary on a "data" event. Like if I have: process.on('data', funcDoAThing); How often is doAThing called? Is there a byte limit? I don't understand when I would see a "chunk" of data. Knifegrab fucked around with this message at 01:20 on Oct 6, 2017 |
# ? Oct 5, 2017 17:40 |
|
Knifegrab posted:edit: My last question was dumb and for idiots. I have a newer more dumb question. Assuming by "stream of data" you mean a bytestream, "the first line" actually means "everything from the first byte up to the first line ending". What a line ending is will depend on the system sending it. Windows and other dinosaurs use \r\n, while everything else uses \n. Knifegrab posted:Also what is the boundary on a "data" event. Like if I have: You cannot control or predict it. If you want to use specific segments of it, you'll need to save it to a local buffer and use that. code:
|
# ? Oct 6, 2017 04:13 |
|
I'm dealing with an not-so-edge edge case with text search on a MongoDB (3.4) through Node. I've got the field I'm searching indexed as text. The search ignores diacritics (like the e in Beyoncé here). So, if I type a diacritic into the search, like this: îphone -- I get iPhone results as expected. HOWEVER, if I search for "beyonce", I don't get any of the rows that have Beyoncé stored with an accent over the e. Only if I search with the diacritic do I actually get Beyoncé results. EDIT: I've also got $diacriticSensitive set to false, but it's not doing what I think it ought to do. The text index should be diacritic insensitive by default in Mongo 3.2+, but it's not a two-way insensitivity somehow? I guess I could write logic just to handle Beyoncé, but is there a better way to handle this? My very naive approach right now is if any searches give 0 results and have an "e" in them, I would rerun the search with all "e"s replaced with "é"s. plasticbugs fucked around with this message at 05:20 on Oct 6, 2017 |
# ? Oct 6, 2017 05:15 |
|
I can only think to have someting like php's iconv() in ASCII//TRANSLIT mode to store a 'searchable' string of plain ascii on the side. https://github.com/bnoordhuis/node-iconv Ranzear fucked around with this message at 07:58 on Oct 6, 2017 |
# ? Oct 6, 2017 07:55 |
|
Roadie posted:Windows and other dinosaurs use \r\n, while everything else uses \n. Does Node on OSX autoconvert \r to \n?
|
# ? Oct 6, 2017 14:07 |
|
I hope not.
|
# ? Oct 6, 2017 14:11 |
Heads up for those still using bower: they are advising you to gtfo.
|
|
# ? Oct 6, 2017 14:42 |
|
They have been for a while. Simply using bower shows a message recommending you move off.
|
# ? Oct 6, 2017 14:49 |
|
Ranzear posted:I can only think to have someting like php's iconv() in ASCII//TRANSLIT mode to store a 'searchable' string of plain ascii on the side. This should work! I'll store searchable text alongside each record and will report back on results. Edit: I tried iconv, but it was giving me Beyonc'e instead of Beyonce, so I used a module called 'remove-accents' and that did the trick. I added a searchable text field with all accents removed and it works perfectly. Thanks for the help! plasticbugs fucked around with this message at 20:10 on Oct 6, 2017 |
# ? Oct 6, 2017 17:21 |
|
plasticbugs posted:I tried iconv, but it was giving me Beyonc'e instead of Beyonce code:
The PHP docs note that it may be system dependent. I copypasted your 'Beyoncé' but maybe yours is a composite character and it's doing the diacritic separately? Are you missing 'UTF-8' as the first arg? Ranzear fucked around with this message at 21:03 on Oct 6, 2017 |
# ? Oct 6, 2017 20:50 |
|
Can someone help me out here? I'm taking a JavaScript class and I hosed this assignment up enough it dropped me a letter grade but I'm still not 100% on what I did wrong. It's supposed to prompt you for a letter (and the instructor wants everything pirate themed ). Then eventually write that to the page with true or false for each 0 or 1. I know I'm not grasping some simple js concept cause I'm a loving idiot. Apparently I'm not calling the function right but I dunno why but the way the instructor and ta explain it to me I just can't comprehend. This is the first assignment that needed returns and I feel like I'm not grasping what a return does correctly too. myself posted:$(document).ready(function() { tldr: help me I'm stupid at JavaScript and if I can't grasp calling a function and returns I'm probably gonna fail every assignment for the rest of the semester.
|
# ? Oct 7, 2017 21:03 |
|
Coco Rodreguiz posted:Can someone help me out here? I'm taking a JavaScript class and I hosed this assignment up enough it dropped me a letter grade but I'm still not 100% on what I did wrong. Well, I haven't looked terribly closely... but at the end, you just call all your functions without any parameters. Why are you returning values and expecting parameters if you are not using them? Edit: Ok, that's what you are not getting... Imagine you want to encapsulate some code that does something for you. Specifically, calculate PI. Lets call that getPI(). That function might look something like "function getPI() { return 3.14; }". What this means, is if you then call it, you will get the value from the return statement. So you can do "var pi = getPI();". Now pi = 3.14. You can also pass information into functions. So you could do like "function getArea(radius) { return getPI() * radius * radius; }". You would call it like "var area = getArea(3)". Skandranon fucked around with this message at 21:11 on Oct 7, 2017 |
# ? Oct 7, 2017 21:05 |
|
Coco Rodreguiz posted:I'm taking a JavaScript class quote:$(document).ready I get that libraries and frameworks are a thing, but you should be learning without JQuery first.
|
# ? Oct 7, 2017 23:27 |
|
Ranzear posted:
He's got a long ways to go... needs to get functions, parameters, and return values down first.
|
# ? Oct 8, 2017 00:27 |
|
|
# ? Jun 5, 2024 04:18 |
|
code:
|
# ? Oct 8, 2017 00:29 |