<?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: Lluís Camino</title>
    <description>The latest articles on DEV Community by Lluís Camino (@lluiscamino).</description>
    <link>https://dev.to/lluiscamino</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%2F135783%2F266f0b10-13c4-4b8e-bde3-8cd0b90831c6.jpeg</url>
      <title>DEV Community: Lluís Camino</title>
      <link>https://dev.to/lluiscamino</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lluiscamino"/>
    <language>en</language>
    <item>
      <title>I published my first NPM package!</title>
      <dc:creator>Lluís Camino</dc:creator>
      <pubDate>Tue, 16 Jul 2019 16:04:16 +0000</pubDate>
      <link>https://dev.to/lluiscamino/i-published-my-first-npm-package-3c35</link>
      <guid>https://dev.to/lluiscamino/i-published-my-first-npm-package-3c35</guid>
      <description>&lt;p&gt;While working on the development of my website, I found myself looking for a solution that gave me the color GitHub defines for each programming language so that I could style tags in posts with a significant color, similar to what Dev.to does:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--AEwwenAF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/1di8gwkdyi9gf0u3xr0n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--AEwwenAF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/1di8gwkdyi9gf0u3xr0n.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Although some packages that do this job already existed, I decided that instead of using one of them, I could create a simpler package that just returned the color of a language and not other data that GitHub also provides and I didn't need.&lt;/p&gt;

&lt;p&gt;So, using &lt;a href="https://github.com/ozh/github-colors/blob/master/colors.json"&gt;this JSON file&lt;/a&gt;, I created the simplest NPM package that can possibly be done: one that returns the color of any programming language.&lt;/p&gt;

&lt;p&gt;I also did &lt;a href="https://lluiscamino.github.io/github-lang-colors/"&gt;a prototype&lt;/a&gt; that shows how this package works:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--AU8mgwhb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/0jsewveekbt83anajuxy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--AU8mgwhb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/0jsewveekbt83anajuxy.gif" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You just have to type the language you want, hit enter and it will be displayed with its own color. 🤗 &lt;/p&gt;

&lt;p&gt;I know that this is a simple package, and it might not be very useful, here's both NPM and GitHub repo's links (that contain installation and usage instructions) in case someone needs it.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.npmjs.com/package/github-lang-colors"&gt;NPM package&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/lluiscamino/github-lang-colors"&gt;GitHub repository&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vJ70wriM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/github-logo-ba8488d21cd8ee1fee097b8410db9deaa41d0ca30b004c0c63de0a479114156f.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/lluiscamino"&gt;
        lluiscamino
      &lt;/a&gt; / &lt;a href="https://github.com/lluiscamino/github-lang-colors"&gt;
        github-lang-colors
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Get the color of a programming language easily! 👨‍💻
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;h1&gt;
github-lang-colors&lt;/h1&gt;
&lt;p&gt;&lt;a href="https://www.npmjs.com/package/github-lang-colors" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/17e5900c22194e156d41cb0d2bb56fc3f590fd3b/68747470733a2f2f62616467652e667572792e696f2f6a732f6769746875622d6c616e672d636f6c6f72732e737667" alt="npm version"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Simple package that returns the color GitHub has defined for any programming language.&lt;/p&gt;
&lt;h2&gt;
Installation&lt;/h2&gt;
&lt;p&gt;Via npm:&lt;/p&gt;
&lt;div class="highlight highlight-source-shell"&gt;&lt;pre&gt;npm i github-lang-colors&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;
Usage&lt;/h2&gt;
&lt;div class="highlight highlight-source-js"&gt;&lt;pre&gt;&lt;span class="pl-k"&gt;const&lt;/span&gt; &lt;span class="pl-s1"&gt;getColor&lt;/span&gt; &lt;span class="pl-c1"&gt;=&lt;/span&gt; &lt;span class="pl-en"&gt;require&lt;/span&gt;&lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-s"&gt;'github-lang-colors'&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt;&lt;span class="pl-kos"&gt;;&lt;/span&gt;
&lt;span class="pl-smi"&gt;console&lt;/span&gt;&lt;span class="pl-kos"&gt;.&lt;/span&gt;&lt;span class="pl-en"&gt;log&lt;/span&gt;&lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-s1"&gt;getColor&lt;/span&gt;&lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-s"&gt;'JavaScript'&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt;&lt;span class="pl-kos"&gt;;&lt;/span&gt; &lt;span class="pl-c"&gt;// #f1e05a&lt;/span&gt;
&lt;span class="pl-smi"&gt;console&lt;/span&gt;&lt;span class="pl-kos"&gt;.&lt;/span&gt;&lt;span class="pl-en"&gt;log&lt;/span&gt;&lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-s1"&gt;getColor&lt;/span&gt;&lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-s"&gt;'PHP'&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt;&lt;span class="pl-kos"&gt;;&lt;/span&gt; &lt;span class="pl-c"&gt;// #4f5d95&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Note that the function is not case-sensitive.&lt;/p&gt;
&lt;div class="highlight highlight-source-js"&gt;&lt;pre&gt;&lt;span class="pl-smi"&gt;console&lt;/span&gt;&lt;span class="pl-kos"&gt;.&lt;/span&gt;&lt;span class="pl-en"&gt;log&lt;/span&gt;&lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-en"&gt;getColor&lt;/span&gt;&lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-s"&gt;'php'&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt;&lt;span class="pl-kos"&gt;;&lt;/span&gt; &lt;span class="pl-c"&gt;// #4f5d95&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;
Language colors source&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/ozh/github-colors"&gt;ozh/github-colors&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;



&lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/lluiscamino/github-lang-colors"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


</description>
      <category>npm</category>
      <category>newbie</category>
      <category>javascript</category>
      <category>github</category>
    </item>
  </channel>
</rss>
