JSConf 2014

Diseñando módulos para NodeJS y para el navegador con Browserify

Kevin Whinnery  · 




Extracto de la transcripción automática del vídeo realizada por YouTube.

everybody my name is Kevin I work for a outfit called Twilio and if you haven't had a chance to use Tullio before it lets you do cool stuff like make and receive phone calls send and receive text or picture messages and I enabled what calling in your desktop

browsers or mobile apps and also I actually wrote the note module for Twilio and I think I'm actually gonna add a high-level helper that is a one liner so that Angelina Fabio brings you brings you tacos as you saw in one of the last talks so that was pretty

awesome great use of Tullio and if you think any of that stuff might be fun to play around with I just go ahead and NPM install Tulio but that's not what I'm here to talk about today I'd like to talk a little bit about again one of my favorite

tools for use with node.js which is browserify and for me it's actually sort of the key tool which unlocks the promise of node to allow you to share code between the client and the server side and it's also really useful even beyond the browser really

a browser if I house you to do is to package up the node.js module system and basically create a single javascript file that you can evaluate in any JavaScript environment but lets you write your javascript in such a way where you can you know structure your

code in as no jazz style common J's modules so it's really cool if you haven't used it before I definitely encourage you to do so because it allows you to start to share culture if you will with both declined in the server side in your JavaScript

code on just having the same language on both ends of the wire is pretty cool but if you actually want to reuse it should be written in the same style and kind of live in the same ecosystem as you know it has one another so that's why I think browser if

I really enables a lot of the really cool stuff that we sort of are hoping to realize with nodejs so I if you are writing a node.js module today that you're supporting out on NPM a lot of modules with browserify today will just work so it could be that

you have no work to do to make your mount module browser a file but you might want to do a little bit of extra work if your module meets one of these two criteria so if your if the functionality that you're shipping in your module has sort of complimentary

ap is that you can they're slightly different that you can use both on the client and the server side one example would be the ws module the web socket a popular web socket library for node in the browser when you require it it gives you a cross platform

or a you know a browser specific version of the web socket implementation that exists on that browser and and then on the server side it gives you a WebSocket server that you can then use so if your module sort of could benefit from having sort of nice nice

interfaces that are that are connected on both the client and the server then you probably won't want to look at some of the more advanced features of browser five also sometimes your module isn't just going to work so if your module does any kind

of a file system i/o or something along those lines obviously that's not going to work a node or excuse me with browserify but basra fidos provide shims for most of nodes core libraries so a lot of the NPM universe just kind of works today so your module

[ ... ]

Nota: se han omitido las otras 1.674 palabras de la transcripción completa para cumplir con las normas de «uso razonable» de YouTube.