<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Chai on ZeroSharp</title><link>https://www.zerosharp.com/blog/categories/chai/</link><description>Recent content in Chai on ZeroSharp</description><generator>Hugo</generator><language>en-gb</language><copyright>Copyright © 2012–{year} Robert Anderson</copyright><lastBuildDate>Tue, 09 Feb 2016 11:31:00 +0100</lastBuildDate><atom:link href="https://www.zerosharp.com/blog/categories/chai/index.xml" rel="self" type="application/rss+xml"/><item><title>Serverless Framework Part 5: Pulling in a node package</title><link>https://www.zerosharp.com/serverless-framework-part-5-pulling-in-a-node-package/</link><pubDate>Tue, 09 Feb 2016 11:31:00 +0100</pubDate><guid>https://www.zerosharp.com/serverless-framework-part-5-pulling-in-a-node-package/</guid><description>&lt;p&gt;This is the final part of an ongoing series about the &lt;a href="https://github.com/serverless/serverless"&gt;Serverless framework&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In the previous posts, the &lt;code&gt;PasswordGenerator&lt;/code&gt; always returned &amp;lsquo;Password&amp;rsquo;. Instead each date should corresponds to a new unique password. We&amp;rsquo;ll make use of the &lt;a href="https://www.npmjs.com/package/crypto-js"&gt;Crypto-js&lt;/a&gt; node package and we&amp;rsquo;ll see that the AWS lambda copes just fine.&lt;/p&gt;
&lt;h3 id="installing-a-node-package"&gt;Installing a node package&lt;/h3&gt;
&lt;p&gt;Pull in the crypto-js package into the serverless component.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ cd nodejscomponent/
$ npm install crypto-js --save
crypto-js@3.1.6 node_modules/crypto-js
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now we need the typescript definitions. Watch out there are two different TypeScript typings called &lt;em&gt;cryptojs&lt;/em&gt; and &lt;em&gt;crypto-js&lt;/em&gt;. The first one is more complete.&lt;/p&gt;</description></item></channel></rss>