<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Joe Snell</title>
    <description>The latest articles on DEV Community by Joe Snell (@wulfmann).</description>
    <link>https://dev.to/wulfmann</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F12779%2F4313116.jpeg</url>
      <title>DEV Community: Joe Snell</title>
      <link>https://dev.to/wulfmann</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/wulfmann"/>
    <language>en</language>
    <item>
      <title>Hide Rick Rolls in a Spotify Link</title>
      <dc:creator>Joe Snell</dc:creator>
      <pubDate>Mon, 13 May 2024 19:31:26 +0000</pubDate>
      <link>https://dev.to/wulfmann/spotify-rick-roll-8ec</link>
      <guid>https://dev.to/wulfmann/spotify-rick-roll-8ec</guid>
      <description>&lt;p&gt;Last night, my brother messaged me a spotify link, but when I tapped it, it took me somewhere else entirely.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fltlmne7992nuj5rhfpk1.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fltlmne7992nuj5rhfpk1.jpg" alt="Screenshot of my brother sending me a weird link"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;tldr; I made a thing to hide rick rolls in spotify links: &lt;a href="https://spotify-rickroll.vercel.app/" rel="noopener noreferrer"&gt;https://spotify-rickroll.vercel.app/&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;After copying the link to a note to see the raw URL, I saw that there was a query string with URL encoded values.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

https://open.spotify.com/track/66cuLvkHsW7dNkfNk6gQP9?context=spotify%3Aalbum%3A6DUyohk95eun9LArJtHyF7


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The API reference is light on details, but spotify mobile apps appear to resolve whatever spotify URI is passed in the &lt;code&gt;context&lt;/code&gt; parameter (the web UI did not behave this way).&lt;/p&gt;

&lt;p&gt;After inspecting the URL I realized that the first ID in the URL (&lt;code&gt;66cuLvkHsW7dNkfNk6gQP9&lt;/code&gt;) matched &lt;a href="https://open.spotify.com/track/66cuLvkHsW7dNkfNk6gQP9" rel="noopener noreferrer"&gt;A Wolf At the Door&lt;/a&gt; by Radiohead and the second ID in the query string (&lt;code&gt;6DUyohk95eun9LArJtHyF7&lt;/code&gt;) indeed matched the album &lt;a href="https://open.spotify.com/album/6DUyohk95eun9LArJtHyF7" rel="noopener noreferrer"&gt;Country&lt;/a&gt; by Medium Build (a fantastic album you should check out).&lt;/p&gt;

&lt;p&gt;After creating some more examples (linking to a search, a podcast, etc.), I discovered that using: &lt;code&gt;spotify:track:&amp;lt;track id&amp;gt;&lt;/code&gt; will cause the track to automatically play. The value of this was quickly realized with a certain (infamous) spotify ID &lt;code&gt;4PTG3Z6ehGkBFwjybzWkR8&lt;/code&gt; (copy paste into a message to try it out):&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

https://open.spotify.com/track/7pqmuOzAXmnuAXP68LSjD5?context=spotify%3Atrack%3A4PTG3Z6ehGkBFwjybzWkR8


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2f7l21j5503l11kxq4v5.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2f7l21j5503l11kxq4v5.jpg" alt="Screenshot of a conversation where my sister got got"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After crafting a few more by hand, I threw together a simple website to handle parsing the track IDs and generating a rick roll (or optionally a different target track entirely).&lt;/p&gt;

&lt;p&gt;After spending the morning rick rolling everyone I can think of, I have made it public (&lt;a href="https://github.com/wulfmann/spotify-rickroll" rel="noopener noreferrer"&gt;github&lt;/a&gt;):&lt;/p&gt;

&lt;p&gt;You can generate your own links here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://spotify-rickroll.vercel.app/" rel="noopener noreferrer"&gt;https://spotify-rickroll.vercel.app/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Misc. observations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;This appears to only work on mobile apps (tested on ios and android)&lt;/li&gt;
&lt;li&gt;iOS provides the most impact because it automatically renders the preview track whereas Android requires you to tap to display the preview&lt;/li&gt;
&lt;li&gt;How the spotify app generated one of these links in the first place does appear to be a somewhat difficult to reproduce bug. If anyone from the spotify team would like to get any of the original links with the &lt;code&gt;si&lt;/code&gt; values please reach out.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6pwnly9itaah444y6zaq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6pwnly9itaah444y6zaq.png" alt="Rick Astley in all his glory"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Enjoy ❤️&lt;/p&gt;

</description>
      <category>spotify</category>
      <category>rickroll</category>
      <category>javascript</category>
      <category>bug</category>
    </item>
    <item>
      <title>🚀 Vercel API Client for Python</title>
      <dc:creator>Joe Snell</dc:creator>
      <pubDate>Tue, 28 Jul 2020 19:21:11 +0000</pubDate>
      <link>https://dev.to/wulfmann/vercel-api-client-for-python-2hd9</link>
      <guid>https://dev.to/wulfmann/vercel-api-client-for-python-2hd9</guid>
      <description>&lt;h2&gt;
  
  
  Overview
&lt;/h2&gt;

&lt;p&gt;Introducing a python sdk for interacting with the Vercel API!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;vercel
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Get started in just a few lines:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;vercel&lt;/span&gt;

&lt;span class="n"&gt;vercel&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;api_token&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;xxxxxx&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;

&lt;span class="n"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;vercel&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;User&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="c1"&gt;# { ... }
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Or you can remix this glitch project:&lt;/p&gt;


&lt;div class="glitch-embed-wrap"&gt;
  &lt;iframe src="https://glitch.com/embed/#!/embed/plump-troubled-dust?path=index.html" alt="plump-troubled-dust on glitch"&gt;&lt;/iframe&gt;
&lt;/div&gt;



&lt;h2&gt;
  
  
  Get Involved
&lt;/h2&gt;

&lt;p&gt;If you'd like to get involved, check out the repo below:&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/wulfmann" rel="noopener noreferrer"&gt;
        wulfmann
      &lt;/a&gt; / &lt;a href="https://github.com/wulfmann/vercel" rel="noopener noreferrer"&gt;
        vercel
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Python SDK for the Vercel API
    &lt;/h3&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;You can see the supported resources &lt;a href="https://github.com/wulfmann/vercel/blob/master/docs/supported-resources.md" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you'd like to contribute or find a bug feel free to &lt;a href="https://github.com/wulfmann/vercel/issues/new/choose" rel="noopener noreferrer"&gt;open an issue&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;Follow me on &lt;a href="https://twitter.com/wlfmnn" rel="noopener noreferrer"&gt;twitter&lt;/a&gt;&lt;/p&gt;

</description>
      <category>sdk</category>
      <category>python</category>
      <category>showdev</category>
      <category>vercel</category>
    </item>
    <item>
      <title>Generating ACM certificates for a Vercel-managed domain.</title>
      <dc:creator>Joe Snell</dc:creator>
      <pubDate>Tue, 21 Jul 2020 13:08:31 +0000</pubDate>
      <link>https://dev.to/wulfmann/generating-acm-certificates-for-a-vercel-managed-domain-gk5</link>
      <guid>https://dev.to/wulfmann/generating-acm-certificates-for-a-vercel-managed-domain-gk5</guid>
      <description>&lt;p&gt;When you use &lt;a href="https://vercel.com"&gt;Vercel&lt;/a&gt; to manage your DNS records, they &lt;a href="https://vercel.com/docs/v2/edge-network/encryption?query=certificates#"&gt;generate SSL certificates&lt;/a&gt; for you.&lt;/p&gt;

&lt;p&gt;I want to manage my DNS with Vercel, but still need an &lt;a href="https://docs.aws.amazon.com/acm/latest/userguide/acm-overview.html"&gt;ACM Certificate&lt;/a&gt; in my AWS account. I've done this before with &lt;a href="https://aws.amazon.com/route53/"&gt;Route 53&lt;/a&gt;, but with Vercel I kept seeing mysterious failures.&lt;/p&gt;

&lt;p&gt;After trying &lt;a href="https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-validate-email.html"&gt;Email Validation&lt;/a&gt;, I switched to &lt;a href="https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-validate-dns.html"&gt;DNS Validation&lt;/a&gt;. I still got errors, but this time I got more information:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;The status of this certificate request is "Failed". One or more domain names have failed validation due to a Certificate Authority Authentication (CAA) error&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;After googling around, I found &lt;a href="https://docs.aws.amazon.com/acm/latest/userguide/troubleshooting-DNS-validation.html"&gt;this note&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;One or more domain names have failed validation due to a Certification Authority Authentication (CAA) error, check your CAA DNS records.&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;After going back to my domain in the Vercel dashboard, I found this record:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;CAA 0 issue "letsencrypt.org"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Since there is no &lt;a href="https://en.wikipedia.org/wiki/DNS_Certification_Authority_Authorization"&gt;CAA Record&lt;/a&gt; allowing amazon to issue certificates, the request fails.&lt;/p&gt;

&lt;p&gt;AWS &lt;a href="https://docs.aws.amazon.com/acm/latest/userguide/setup-caa.html"&gt;provides documentation&lt;/a&gt; on how to configure a CAA record to allow ACM to generate certs. We need to add an extra record in Vercel:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;CAA 0 issue "amazon.com"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Request a new ACM cert and this time it succeeds!&lt;/p&gt;

</description>
      <category>aws</category>
      <category>vercel</category>
      <category>acm</category>
      <category>certificate</category>
    </item>
    <item>
      <title>Introducing `bump-cdk`</title>
      <dc:creator>Joe Snell</dc:creator>
      <pubDate>Wed, 15 Jul 2020 14:21:25 +0000</pubDate>
      <link>https://dev.to/wulfmann/introducing-bump-cdk-896</link>
      <guid>https://dev.to/wulfmann/introducing-bump-cdk-896</guid>
      <description>&lt;h2&gt;
  
  
  Quickstart
&lt;/h2&gt;

&lt;p&gt;From a directory that contains a &lt;code&gt;package.json&lt;/code&gt; with &lt;a href="https://github.com/aws/aws-cdk"&gt;aws-cdk&lt;/a&gt; dependencies run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;npx bump-cdk
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should now have those dependencies upgraded and pinned to the same version!&lt;/p&gt;

&lt;p&gt;You can check out the source &lt;a href="https://github.com/cdk-tools/bump-cdk/tree/master/packages/bump-cdk"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why does this exist
&lt;/h2&gt;

&lt;p&gt;A common issue when working with &lt;a href="https://docs.aws.amazon.com/cdk/latest/guide/home.html"&gt;AWS CDK&lt;/a&gt; is version mismatch.&lt;/p&gt;

&lt;p&gt;The way CDK's modules interface together requires them to always be on the same version &lt;a href="https://docs.aws.amazon.com/cdk/latest/guide/troubleshooting.html#troubleshooting_modules"&gt;More Information&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This for example might cause an error:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"dependencies"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"@aws-cdk/core"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"1.30.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"@aws-cdk/aws-lambda"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"1.51.0"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This introduces maintenance overhead by forcing you to always have your CDK dependencies on the same version.&lt;/p&gt;

&lt;p&gt;Additionally, because of &lt;a href="https://docs.npmjs.com/files/package.json#dependencies"&gt;semver&lt;/a&gt;, when you add dependencies, you often end up with a dynamic version range:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;yarn add @aws-cdk/core
...
&lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="s2"&gt;"dependencies"&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="s2"&gt;"@aws-cdk/core"&lt;/span&gt;: &lt;span class="s2"&gt;"^1.30.0"&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This means that the module is "Compatible with version" &lt;code&gt;1.30.0&lt;/code&gt;, but dependencies added at a later date can get out of sync.&lt;/p&gt;

&lt;p&gt;Because of all this, &lt;a href="https://github.com/aws/aws-cdk/issues/3711"&gt;it is recommended&lt;/a&gt; to pin the versions without the semver range modifier.&lt;/p&gt;

&lt;h2&gt;
  
  
  Issues
&lt;/h2&gt;

&lt;p&gt;Feel free to check it out, and if you find any issues or have suggestions feel free to &lt;a href="https://github.com/cdk-tools/bump-cdk/issues/new"&gt;open an issue&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>awscdk</category>
      <category>aws</category>
      <category>node</category>
    </item>
    <item>
      <title>pin-latest: Easily resolve package.json “latest” versions</title>
      <dc:creator>Joe Snell</dc:creator>
      <pubDate>Thu, 09 Jul 2020 16:03:17 +0000</pubDate>
      <link>https://dev.to/wulfmann/pin-latest-small-utility-for-managing-node-dependency-versions-2o52</link>
      <guid>https://dev.to/wulfmann/pin-latest-small-utility-for-managing-node-dependency-versions-2o52</guid>
      <description>&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/wulfmann" rel="noopener noreferrer"&gt;
        wulfmann
      &lt;/a&gt; / &lt;a href="https://github.com/wulfmann/pin-latest" rel="noopener noreferrer"&gt;
        pin-latest
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Small utility for converting `package.json` versions from `latest` to the actual latest version.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;pin-latest&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;Small utility for converting &lt;code&gt;package.json&lt;/code&gt; versions from &lt;code&gt;latest&lt;/code&gt; to the actual latest version.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Quickstart&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;Install&lt;/p&gt;
&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;npm i -g pin-latest
&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; or&lt;/span&gt;
yarn global add pin-latest
&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; or&lt;/span&gt;
npx pin-latest&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Given the following &lt;code&gt;package.json&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight highlight-source-json notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;{
    &lt;span class="pl-ent"&gt;"name"&lt;/span&gt;: &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;example-project&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;,
    &lt;span class="pl-ent"&gt;"dependencies"&lt;/span&gt;: {
        &lt;span class="pl-ent"&gt;"react"&lt;/span&gt;: &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;latest&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;
    }
}&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Running &lt;code&gt;pin-latest&lt;/code&gt; will result in the following output:&lt;/p&gt;
&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;$ pin-latest &lt;span class="pl-c1"&gt;.&lt;/span&gt;

{
    &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;name&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;: &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;example-project&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;,
    &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;dependencies&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;: {
        &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;react&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;: &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;^16.13.1&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;
    }
}&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;To save changes pass the &lt;code&gt;--write&lt;/code&gt; flag:&lt;/p&gt;
&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;$ pin-latest &lt;span class="pl-c1"&gt;.&lt;/span&gt;
package.json updated.

$ cat package.json
{
    &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;name&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;: &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;example-project&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;,
    &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;dependencies&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;: {
        &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;react&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;: &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;^16.13.1&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;
    }
}&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Usage&lt;/h2&gt;

&lt;/div&gt;
&lt;div class="snippet-clipboard-content notranslate position-relative overflow-auto"&gt;
&lt;pre class="notranslate"&gt;&lt;code&gt;$ pin-latest --help
Usage
    $ pin-latest &amp;lt;project-directory&amp;gt;
Options
    --exact, -t     Set the exact version
    --write, -w     Write changes
    --version, -v   Version number
    --help, -h      Displays&lt;/code&gt;&lt;/pre&gt;…&lt;/div&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/wulfmann/pin-latest" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;The purpose of this project is providing an easy way to translate dependency versions specified in a &lt;code&gt;package.json&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Any dependency that specifies a version of &lt;code&gt;latest&lt;/code&gt; will be updated to the actual latest version of the package.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quickstart
&lt;/h2&gt;

&lt;p&gt;Install&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm i &lt;span class="nt"&gt;-g&lt;/span&gt; pin-latest
&lt;span class="c"&gt;# or&lt;/span&gt;
yarn global add pin-latest
&lt;span class="c"&gt;# or&lt;/span&gt;
npx pin-latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Given the following &lt;code&gt;package.json&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;name&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;example-project&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;dependencies&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;latest&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Running &lt;code&gt;pin-latest&lt;/code&gt; will result in the following output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;pin-latest &lt;span class="nb"&gt;.&lt;/span&gt;

&lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="s2"&gt;"name"&lt;/span&gt;: &lt;span class="s2"&gt;"example-project"&lt;/span&gt;,
    &lt;span class="s2"&gt;"dependencies"&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="s2"&gt;"react"&lt;/span&gt;: &lt;span class="s2"&gt;"^16.13.1"&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To save changes pass the &lt;code&gt;--write&lt;/code&gt; flag:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;pin-latest &lt;span class="nb"&gt;.&lt;/span&gt;
package.json updated.

&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cat &lt;/span&gt;package.json
&lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="s2"&gt;"name"&lt;/span&gt;: &lt;span class="s2"&gt;"example-project"&lt;/span&gt;,
    &lt;span class="s2"&gt;"dependencies"&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="s2"&gt;"react"&lt;/span&gt;: &lt;span class="s2"&gt;"^16.13.1"&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;View more information in the &lt;a href="https://github.com/wulfmann/pin-latest" rel="noopener noreferrer"&gt;project’s readme&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>node</category>
      <category>cli</category>
    </item>
  </channel>
</rss>
