<?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: Daniel Newell</title>
    <description>The latest articles on DEV Community by Daniel Newell (@danielnewell).</description>
    <link>https://dev.to/danielnewell</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%2F468967%2F648bc5e7-6883-4c7e-a25c-d116a50bad2a.png</url>
      <title>DEV Community: Daniel Newell</title>
      <link>https://dev.to/danielnewell</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/danielnewell"/>
    <language>en</language>
    <item>
      <title>Drafts</title>
      <dc:creator>Daniel Newell</dc:creator>
      <pubDate>Wed, 09 Dec 2020 17:40:53 +0000</pubDate>
      <link>https://dev.to/danielnewell/drafts-3mfp</link>
      <guid>https://dev.to/danielnewell/drafts-3mfp</guid>
      <description>&lt;p&gt;WHERE DID ALL MY DRAFTS GO!?!?!&lt;/p&gt;

&lt;p&gt;Please help. I'm in mild distress now.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>ForemJS Test Article</title>
      <dc:creator>Daniel Newell</dc:creator>
      <pubDate>Fri, 18 Sep 2020 13:08:00 +0000</pubDate>
      <link>https://dev.to/danielnewell/foremjs-test-article-4b3e</link>
      <guid>https://dev.to/danielnewell/foremjs-test-article-4b3e</guid>
      <description>&lt;h1&gt;
  
  
  Test
&lt;/h1&gt;

&lt;p&gt;This is an article written using the &lt;a href="https://npm.im/foremjs"&gt;ForemJS API Wrapper&lt;/a&gt;. &lt;a href="https://github.com/foremjs/foremjs"&gt;GitHub&lt;/a&gt;&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>contributorswanted</category>
      <category>node</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Introducing ForemJS: The API Wrapper for Dev.to</title>
      <dc:creator>Daniel Newell</dc:creator>
      <pubDate>Fri, 18 Sep 2020 02:20:08 +0000</pubDate>
      <link>https://dev.to/danielnewell/introducing-foremjs-the-api-wrapper-for-dev-to-5amo</link>
      <guid>https://dev.to/danielnewell/introducing-foremjs-the-api-wrapper-for-dev-to-5amo</guid>
      <description>&lt;p&gt;If you hadn't already known, Dev.to has access to an API. You can access it &lt;a href="https://docs.forem.com/api/"&gt;here&lt;/a&gt;. For my lovely NodeJS developers, I've started developing an &lt;a href="https://github.com/foremjs/foremjs"&gt;open-souce&lt;/a&gt; API wrapper for it called &lt;a href="https://www.npmjs.com/package/foremjs"&gt;ForemJS&lt;/a&gt;.&lt;/p&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/foremjs"&gt;
        foremjs
      &lt;/a&gt; / &lt;a href="https://github.com/foremjs/foremjs"&gt;
        foremjs
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      A NodeJS wrapper for https://docs.forem.com/api/
    &lt;/h3&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Currently, it is very limited but I have plans to cover the entire API. ForemJS runs asynchronously, so you will have to use &lt;code&gt;await&lt;/code&gt;, or &lt;code&gt;.then()&lt;/code&gt; callbacks. I am currently working on documentation, but here are the basics of how it works.&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 1 - Install the Package
&lt;/h1&gt;

&lt;p&gt;&lt;code&gt;npm i foremjs@0.1.x&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;As by &lt;a href="https://semver.org"&gt;SemVer&lt;/a&gt;, while the MAJOR version is still 0, breaking changes may occur. The PATCH versions (0.1.x) are going to be adding documentation, and polished up the wrapper as per people's specifications. The next MINOR (0.2.0) version should cover more of the API and get ready for 1.0.0. &lt;/p&gt;

&lt;h1&gt;
  
  
  Step 2 - Require the Package
&lt;/h1&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Forem&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;foremjs&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;This is a simple process of just requiring the package.&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 3 - Create a Client
&lt;/h1&gt;

&lt;p&gt;You will have to get a token from your &lt;a href="https://dev.to/settings/account"&gt;settings page&lt;/a&gt;. Now use the following code to create an instance. This is how you will access the API.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Forem&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Client&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;TOKEN&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h1&gt;
  
  
  Step 4 - Use the API
&lt;/h1&gt;

&lt;p&gt;You can use &lt;code&gt;.getArticle(id)&lt;/code&gt; to get an article. These are some of the properties carried by the Article class: &lt;code&gt;.title&lt;/code&gt;, &lt;code&gt;.description&lt;/code&gt;, and &lt;code&gt;.url&lt;/code&gt;. You can see the code for the whole list. There is also &lt;code&gt;.getUser(id)&lt;/code&gt;, however, it is a bit limited by the API itself. You can get things like &lt;code&gt;.createdAt&lt;/code&gt;, and &lt;code&gt;.github&lt;/code&gt; for their username.&lt;/p&gt;

&lt;p&gt;More features are soon to come, such as posting articles. Thank you so much for reading this article. Maybe my next one will be posted using my wrapper? Seriously, though, if you have any questions, comments, or concerns about this project comment them down below and I will respond as soon as possible.&lt;/p&gt;

</description>
      <category>node</category>
      <category>javascript</category>
      <category>forem</category>
      <category>opensource</category>
    </item>
    <item>
      <title>I'm Daniel Newell, and I support women devs.</title>
      <dc:creator>Daniel Newell</dc:creator>
      <pubDate>Thu, 17 Sep 2020 13:16:35 +0000</pubDate>
      <link>https://dev.to/danielnewell/i-m-daniel-newell-and-i-support-women-devs-1n59</link>
      <guid>https://dev.to/danielnewell/i-m-daniel-newell-and-i-support-women-devs-1n59</guid>
      <description>&lt;h2&gt;
  
  
  What is equality?
&lt;/h2&gt;

&lt;p&gt;Equality is not a complicated issue. It is definitely not up for debate. We all have to support devs regardless of age, gender, sexual orientation, disability, race, etc. We all share the same love for creating websites, applications, and more. Equality is the equal treatment of all people regardless of characteristics. &lt;/p&gt;

&lt;h2&gt;
  
  
  How I ensure equality (and how you should too)
&lt;/h2&gt;

&lt;p&gt;I ensure that I work with people regardless of any characteristic. Sme of the best developers I knore are female or non-binary. Being part of it, I also work with the LGBTQ+ community. This isn't something you should brag about, it's human decency.&lt;/p&gt;

&lt;h2&gt;
  
  
  To my female and enby developer friends:
&lt;/h2&gt;

&lt;p&gt;You rock! You are wonderful beings who shouldn't be belittled because of your gender identity. You can do anything anybody else can do, I know it. Keep coding. :)&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Localise your NodeJS app easily with i18n</title>
      <dc:creator>Daniel Newell</dc:creator>
      <pubDate>Tue, 15 Sep 2020 15:25:23 +0000</pubDate>
      <link>https://dev.to/localazy/making-a-nodejs-project-with-localisation-using-localazy-3dm5</link>
      <guid>https://dev.to/localazy/making-a-nodejs-project-with-localisation-using-localazy-3dm5</guid>
      <description>&lt;p&gt;So, you have a NodeJS app, but you only have access to a small subset of people: those who speak your language. Or maybe you have translations, but they are inefficient to implement and take up valuable time you can be using for fixing issues or adding features. In this article, you will learn how to implement Localazy to your NodeJS project.&lt;/p&gt;

&lt;p&gt;Localazy is a translation management platform and it's a great option for developers because of two key features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It comes with ShareTM allowing you to automatically translate your app into 80+ languages for free by sharing translations with other developers.&lt;/li&gt;
&lt;li&gt;With its CLI, it can be easily integrated into any workflow. And we are using the CLI today.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By the way, this tool is &lt;strong&gt;free&lt;/strong&gt;. Pretty cool, right?&lt;/p&gt;

&lt;h1&gt;
  
  
  Part 1 - Getting Ready
&lt;/h1&gt;

&lt;p&gt;Create a &lt;a href="https://localazy.com"&gt;Localazy&lt;/a&gt; account and follow prompts. Create an app, add your languages, and add translators.&lt;/p&gt;

&lt;p&gt;Now, &lt;a href="https://localazy.com/docs/cli/installation"&gt;install&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Create a file called &lt;code&gt;localazy.json&lt;/code&gt; and paste the following. Make sure to gather your keys!&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;"writeKey"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"your-apps-write-key"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; 
  &lt;/span&gt;&lt;span class="nl"&gt;"readKey"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"your-apps-read-key"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;

  &lt;/span&gt;&lt;span class="nl"&gt;"upload"&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;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"json"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"files"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"locales/en.json"&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;"download"&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;"files"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"locales/${lang}.json"&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;Now, we can upload translations. Create &lt;code&gt;en.json&lt;/code&gt; and edit as needed.&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;"appName"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Your Cool App"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"error"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"An error has occurred."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"Hello"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Hello {{name}}"&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;Now run &lt;code&gt;localazy upload&lt;/code&gt; and you should see your translation strings on your home screen. You can use automatic or manual translations. Automatic translations may not be the most accurate, but are a start. When complete, use &lt;code&gt;localazy download&lt;/code&gt; to gather edited files.&lt;/p&gt;

&lt;h1&gt;
  
  
  Part 2 - Development
&lt;/h1&gt;

&lt;p&gt;Install &lt;a href="https://npm.im/i18n"&gt;i18n&lt;/a&gt; via npm. In your code add the following.&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;i18n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;i18n&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nx"&gt;i18n&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;configure&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;locales&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="s1"&gt;en&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="s1"&gt;es&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="s1"&gt;de&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="c1"&gt;// your languages&lt;/span&gt;
  &lt;span class="na"&gt;directory&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;__dirname&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/locales&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
  &lt;span class="na"&gt;register&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;global&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;translate&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;l&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;ph&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;__&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;phrase&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;locale&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;l&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="nx"&gt;ph&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;Now, to translate anything, use the &lt;code&gt;translate()&lt;/code&gt; function, like so:&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="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;translate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hello&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="s1"&gt;de&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="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Daniel&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;}))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Implement this to fit your code, and you are complete!&lt;/p&gt;

&lt;p&gt;If you run into issues, please leave a message and I will fix it as soon as possible.&lt;/p&gt;

&lt;p&gt;Edited on 15 September: Basic style changes and fixed an oversight&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>javascript</category>
      <category>node</category>
    </item>
  </channel>
</rss>
