<?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: Sameer Gurung</title>
    <description>The latest articles on DEV Community by Sameer Gurung (@smrgrg).</description>
    <link>https://dev.to/smrgrg</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%2F358619%2F24f9575f-02c4-4c9f-8fb5-17e72db63eb1.jpg</url>
      <title>DEV Community: Sameer Gurung</title>
      <link>https://dev.to/smrgrg</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/smrgrg"/>
    <language>en</language>
    <item>
      <title>How to run Serverless offline?</title>
      <dc:creator>Sameer Gurung</dc:creator>
      <pubDate>Mon, 30 Mar 2020 02:46:00 +0000</pubDate>
      <link>https://dev.to/smrgrg/how-to-run-serverless-offline-p34</link>
      <guid>https://dev.to/smrgrg/how-to-run-serverless-offline-p34</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---XYC4j_u--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2A6vho_MSCuNHBagYh" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---XYC4j_u--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2A6vho_MSCuNHBagYh" alt=""&gt;&lt;/a&gt;Photo by &lt;a href="https://unsplash.com/@lemonzandtea?utm_source=medium&amp;amp;utm_medium=referral"&gt;Aleksandar Cvetanovic&lt;/a&gt; on &lt;a href="https://unsplash.com?utm_source=medium&amp;amp;utm_medium=referral"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this blog, I will be demonstrating you how to run Serverless Offline using a serverless plugin that emulates &lt;a href="https://aws.amazon.com/lambda"&gt;AWS λ&lt;/a&gt; and &lt;a href="https://aws.amazon.com/api-gateway"&gt;API Gateway&lt;/a&gt; on your local machine to speed up your development cycles. It helps us save time as we can see logs and also debug in our local machine rather than on cloud vendors.&lt;/p&gt;

&lt;p&gt;Local environment reduces conflict with our team members who might be dependant on using the same function (even though in development) that you are working on and might get confused to why the function is not working whilst it was working before. You can make any changes and trials carefree as you will be the only one using this environment (unless you share it to the network) 😜.&lt;/p&gt;

&lt;p&gt;This blog is for those who already know basics of Serverless Framework and its workarounds.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The Serverless Framework helps you build serverless apps with radically less overhead and cost. It provides a powerful, unified experience to develop, deploy, test, secure and monitor your serverless applications. — &lt;a href="https://serverless.com/framework/docs/"&gt;Serverless Framework&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  Steps:
&lt;/h4&gt;

&lt;p&gt;Since you already know the basics of Serverless Framework, you must have installed the &lt;a href="https://serverless.com/"&gt;framework&lt;/a&gt;. Next, install the package serverless-offline from npm.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install package — serverless-offline
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install serverless-offline --save-dev
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Add this installed plugin to your serverless project.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;plugins:

  - serverless-offline
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Run serverless offline using command:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt; serverless offline 

or

&amp;gt; sls offline
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;You can see the list of available endpoints on &lt;a href="http://localhost:3000/"&gt;http://localhost:3000/&lt;/a&gt; and also use &lt;a href="http://localhost:3000/"&gt;http://localhost:3000/&lt;/a&gt; a base endpoint. Additional usage and command line options are available on the plugin’s official &lt;a href="https://www.npmjs.com/package/serverless-offline#usage-and-command-line-options"&gt;documentation&lt;/a&gt;page.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Reference:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://github.com/dherault/serverless-offline"&gt;https://github.com/dherault/serverless-offline&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;




</description>
      <category>localdevelopment</category>
      <category>awslambda</category>
      <category>serverless</category>
      <category>serverlessoffline</category>
    </item>
    <item>
      <title>Git basics in a FLASH!</title>
      <dc:creator>Sameer Gurung</dc:creator>
      <pubDate>Thu, 19 Mar 2020 10:59:54 +0000</pubDate>
      <link>https://dev.to/smrgrg/git-basics-in-a-flash-22p</link>
      <guid>https://dev.to/smrgrg/git-basics-in-a-flash-22p</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RajI2gx5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AaijSXzTiiKWG7Ymc" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RajI2gx5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AaijSXzTiiKWG7Ymc" alt=""&gt;&lt;/a&gt;Photo by &lt;a href="https://unsplash.com/@yancymin?utm_source=medium&amp;amp;utm_medium=referral"&gt;Yancy Min&lt;/a&gt; on &lt;a href="https://unsplash.com?utm_source=medium&amp;amp;utm_medium=referral"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hello World! Apart from adding, committing and pushing files to the repository, here are some common git operations, in a flash!&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Branching
&lt;/h3&gt;

&lt;p&gt;Branching is necessary when you want to work on a new feature (or for other reasons) and separate your code from master branch.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Create a branch and checkout:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git checkout -b nameOfYourNewBranch
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Delete a local branch :&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git branch -d branchName
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Delete a remote branch:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git push origin -d branchName
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Merging
&lt;/h3&gt;

&lt;p&gt;Merging a branch is necessary because you might want to merge a feature branch to the master branch.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Start a new feature

git checkout -b new-feature master

# Edit some files

git add &amp;lt;file&amp;gt;

git commit -m “Start a feature”

# Edit some files

git add &amp;lt;file&amp;gt;

git commit -m “Finish a feature”

# Merge in the new-feature branch

git checkout master

git merge new-feature

# Delete the new-feature branch

git branch -d new-feature
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Stashing
&lt;/h3&gt;

&lt;p&gt;Stashing is used when you temporarily want to put away your change and have the clean woking tree. Don’t worry, you will be able to get your stashed changes back.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stashing current work:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git stash
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Listing stashes&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git stash list
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Importing latest stash:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git stash pop
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Importing particular stash if more than one:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git stash pop stash@{n}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Dropping stash:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git stash drop stash@{n}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Here, n refers to a number, 0, 1, 2… which represents which stash to delete.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Cleaning Cache
&lt;/h3&gt;

&lt;p&gt;Cleaning cache is required when you want to remove previously added files which you don’t want to track anymore.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Clean all git cache:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git rm -r --cached .
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Clean cache of only required file:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git rm fileName --cached
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;






</description>
      <category>versioncontrol</category>
      <category>gitbasics</category>
      <category>programming</category>
      <category>git</category>
    </item>
    <item>
      <title>5 JavaScript array methods you need to know!</title>
      <dc:creator>Sameer Gurung</dc:creator>
      <pubDate>Thu, 06 Feb 2020 03:06:01 +0000</pubDate>
      <link>https://dev.to/smrgrg/5-javascript-array-methods-you-need-to-know-3gk0</link>
      <guid>https://dev.to/smrgrg/5-javascript-array-methods-you-need-to-know-3gk0</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9N_LASgx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AYwt0eUtSwsyndL87" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9N_LASgx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AYwt0eUtSwsyndL87" alt=""&gt;&lt;/a&gt;Photo by &lt;a href="https://unsplash.com/@mohamad_mahdi?utm_source=medium&amp;amp;utm_medium=referral"&gt;Mohamad Mahdi Abbasi&lt;/a&gt; on &lt;a href="https://unsplash.com?utm_source=medium&amp;amp;utm_medium=referral"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;These are some JavaScript array methods you need to know to make your life a bit easier.&lt;/p&gt;

&lt;h4&gt;
  
  
  1. Array.map()
&lt;/h4&gt;

&lt;p&gt;The &lt;strong&gt;map()&lt;/strong&gt; method &lt;strong&gt;creates a new array&lt;/strong&gt; populated with the results of calling a provided function on every element in the calling array.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const array1 = [1, 4, 9, 16];

// pass a function to map
const map1 = array1.map(x =&amp;gt; x \* 2);

console.log(map1);
// expected output: Array [2, 8, 18, 32]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h4&gt;
  
  
  2. Array.find()
&lt;/h4&gt;

&lt;p&gt;The &lt;strong&gt;find()&lt;/strong&gt; method returns the &lt;strong&gt;value&lt;/strong&gt; of the &lt;strong&gt;first element&lt;/strong&gt; in the provided array that satisfies the provided testing function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const array1 = [5, 12, 8, 130, 44];

const found = array1.find(element =&amp;gt; element &amp;gt; 10);

console.log(found);
// expected output: 12
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h4&gt;
  
  
  3. Array.filter()
&lt;/h4&gt;

&lt;p&gt;The &lt;strong&gt;filter()&lt;/strong&gt; method &lt;strong&gt;creates a new array&lt;/strong&gt; with all elements that pass the test implemented by the provided function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const words = ['spray', 'limit', 'elite', 'exuberant', 'destruction', 'present'];

const result = words.filter(word =&amp;gt; word.length &amp;gt; 6);

console.log(result);
// expected output: Array ["exuberant", "destruction", "present"]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h4&gt;
  
  
  4. Array.forEach()
&lt;/h4&gt;

&lt;p&gt;The &lt;strong&gt;forEach()&lt;/strong&gt; method executes a provided function once for each array element.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const array1 = ['a', 'b', 'c'];

array1.forEach(element =&amp;gt; console.log(element));

// expected output: "a"
// expected output: "b"
// expected output: "c"
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h4&gt;
  
  
  5. Array.slice() and Array.splice()
&lt;/h4&gt;

&lt;p&gt;The &lt;strong&gt;slice()&lt;/strong&gt; method returns a shallow copy of a portion of an array into a new array object selected from begin to end (end not included) where begin and end represent the index of items in that array. The original array will not be modified.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const animals = ['ant', 'bison', 'camel', 'duck', 'elephant'];

console.log(animals.slice(2));
// expected output: Array ["camel", "duck", "elephant"]

console.log(animals.slice(2, 4));
// expected output: Array ["camel", "duck"]

console.log(animals.slice(1, 5));
// expected output: Array ["bison", "camel", "duck", "elephant"]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The &lt;strong&gt;splice()&lt;/strong&gt; method changes the contents of an array by removing or replacing existing elements and/or adding new elements &lt;a href="https://en.wikipedia.org/wiki/In-place_algorithm"&gt;in place&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const months = ['Jan', 'March', 'April', 'June'];
months.splice(1, 0, 'Feb');
// inserts at index 1
console.log(months);
// expected output: Array ["Jan", "Feb", "March", "April", "June"]

months.splice(4, 1, 'May');
// replaces 1 element at index 4
console.log(months);
// expected output: Array ["Jan", "Feb", "March", "April", "May"]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;References:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map"&gt;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find"&gt;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter"&gt;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach"&gt;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice"&gt;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice"&gt;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;




</description>
      <category>arraymethods</category>
      <category>programming</category>
      <category>node</category>
      <category>javascript</category>
    </item>
    <item>
      <title>How to check unused npm packages?</title>
      <dc:creator>Sameer Gurung</dc:creator>
      <pubDate>Mon, 06 Jan 2020 23:11:52 +0000</pubDate>
      <link>https://dev.to/smrgrg/how-to-check-unused-npm-packages-jbb</link>
      <guid>https://dev.to/smrgrg/how-to-check-unused-npm-packages-jbb</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PswTTPAu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AfMh_BsX_5h2MZBqVj_no5A.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PswTTPAu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AfMh_BsX_5h2MZBqVj_no5A.png" alt=""&gt;&lt;/a&gt;Meme showing node_modules as heaviest object in the universe. (source: &lt;a href="https://bit.ly/2IG40Wb"&gt;&lt;/a&gt;&lt;a href="https://bit.ly/2IG40Wb"&gt;https://bit.ly/2IG40Wb&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;I know… I know… After a streak of installing various npm (Node Package Manager) modules, you tend to forget which ones you still use and which ones you already abandoned. Of course, you can check it manually, but why the hassle when you already have a solution?&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Let me introduce you to this genie — ‘depcheck’&lt;/p&gt;

&lt;p&gt;Depcheck is a tool for analyzing the dependencies in a project to see: how each dependency is used, which dependencies are useless, and which dependencies are missing from package.json. — &lt;a href="https://www.npmjs.com/package/depcheck"&gt;npmjs&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Let’s start by installing the package depcheck from npm registry. You can install it globally by entering the following code in your terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install -g depcheck 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Note:&lt;/em&gt; depcheck needs node.js &amp;gt;= 6&lt;/p&gt;

&lt;p&gt;Now, navigate to the folder where you want your dependencies to be checked. Then enter:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;depcheck
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;It takes a while depending upon the project’s complexity and then provides you with results which is similar to the output shown below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OQAa6OGF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AElAnGRWEaN6_s09fELw2wA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OQAa6OGF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AElAnGRWEaN6_s09fELw2wA.png" alt=""&gt;&lt;/a&gt;depcheck performed in freshly installed ionic 4 project&lt;/p&gt;

&lt;p&gt;You can also pass additional parameters according to your need:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;depcheck [directory] [arguments]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The [directory] argument is the root level directory of the project where package.json file is present. It defaults to current directory if not specified.&lt;/p&gt;

&lt;p&gt;The [arguments] parameter can be used to specify different flags to customise our output. For example: --ignore-bin-packages=true ignores the packages containing bin entry.&lt;/p&gt;

&lt;p&gt;Full usage instructions can be found in: &lt;a href="https://www.npmjs.com/package/depcheck#usage"&gt;https://www.npmjs.com/package/depcheck#usage&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Don’t want to install ‘depcheck’? No problem:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you don’t want to install depcheck , you can use npx to run it without installing globally in your machine.&lt;/p&gt;

&lt;p&gt;If you don’t have npx , install it globally by:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install -g npx
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Then, run depcheck by:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx depcheck
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Here,npx will execute the command either from local node_modules/.bin or from a central cache and installs any packages if required.&lt;/p&gt;

&lt;p&gt;Enjoy! 👌&lt;/p&gt;

&lt;p&gt;References:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://www.npmjs.com/package/depcheck"&gt;https://www.npmjs.com/package/depcheck&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.npmjs.com/package/npx"&gt;https://www.npmjs.com/package/npx&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;




</description>
      <category>javascript</category>
      <category>unused</category>
      <category>package</category>
      <category>check</category>
    </item>
    <item>
      <title>Rendering JSON data in HTML</title>
      <dc:creator>Sameer Gurung</dc:creator>
      <pubDate>Mon, 06 Jan 2020 23:10:04 +0000</pubDate>
      <link>https://dev.to/smrgrg/rendering-json-data-in-html-489o</link>
      <guid>https://dev.to/smrgrg/rendering-json-data-in-html-489o</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BMXJGQc2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2Asegq_imNNe49otQR" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BMXJGQc2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2Asegq_imNNe49otQR" alt=""&gt;&lt;/a&gt;Photo by &lt;a href="https://unsplash.com/@wflwong?utm_source=medium&amp;amp;utm_medium=referral"&gt;Warren Wong&lt;/a&gt; on &lt;a href="https://unsplash.com?utm_source=medium&amp;amp;utm_medium=referral"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Tired of teaching your non-IT colleagues how to see what they got as a result from the API? Or are you yourself tired of opening the console?&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Try displaying them in HTML using &lt;a href="https://www.npmjs.com/package/renderjson"&gt;“Renderjson”.&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Renderjson&lt;/strong&gt; is a simple JavaScript package which render JSON into collapsible, themeable HTML. It can be used as debugging tool, however you are the boss and you can use it wherever it is useful.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TmpdUf9Q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn-images-1.medium.com/max/600/1%2A3Yov6_zrmc5ufsMjsieniA.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TmpdUf9Q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn-images-1.medium.com/max/600/1%2A3Yov6_zrmc5ufsMjsieniA.gif" alt=""&gt;&lt;/a&gt;Renderjson example&lt;/p&gt;

&lt;p&gt;The code renders the JSON lazily, only building the HTML when the user reveals the JSON by clicking the disclosure icons. This makes it extremely fast to do the initial render of huge JSON objects, since the only thing that renders initially is a single disclosure icon.&lt;/p&gt;

&lt;h3&gt;
  
  
  Installing Plugin:
&lt;/h3&gt;

&lt;p&gt;npm i renderjson&lt;/p&gt;

&lt;h3&gt;
  
  
  Example Usage:
&lt;/h3&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div **id** ="test"&amp;gt;&amp;lt;/div&amp;gt;

&amp;lt;script **type** ="text/javascript" **src** ="renderjson.js"&amp;gt;&amp;lt;/script&amp;gt;

&amp;lt;script&amp;gt;

document.getElementById("test").appendChild(

renderjson({ hello **:** [1,2,3,4], there **:** { a **:** 1, b **:** 2, c **:** ["hello", null] } })

);

&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Just call the library in whatever way/tech you are using and then append the result of the JSON data passed on to renderjson() function. It takes in the JSON you want to render as a single argument and returns an HTML element.&lt;/p&gt;

&lt;h3&gt;
  
  
  Options:
&lt;/h3&gt;

&lt;p&gt;Call set_show_to_level() to show different amounts of the JSON by default. The default is 0, and 1 is a popular choice. As a special case, if level is the string "all" then all the JSON will be shown by default. This, of course, removes the benefit of the lazy rendering, so it may be slow with large JSON objects.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;renderjson.set\_show\_to\_level(level);
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Other options are discussed in the plugin page: &lt;a href="https://www.npmjs.com/package/renderjson#options"&gt;https://www.npmjs.com/package/renderjson#options&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;References used are from the plugin’s official website: &lt;a href="https://github.com/caldwell/renderjson"&gt;https://github.com/caldwell/renderjson&lt;/a&gt;&lt;/p&gt;




</description>
      <category>javascript</category>
      <category>rendering</category>
      <category>html</category>
      <category>json</category>
    </item>
    <item>
      <title>How to duplicate an existing Zoho configuration to a new account?</title>
      <dc:creator>Sameer Gurung</dc:creator>
      <pubDate>Wed, 20 Nov 2019 05:05:00 +0000</pubDate>
      <link>https://dev.to/smrgrg/how-to-duplicate-an-existing-zoho-configuration-to-a-new-account-3d8</link>
      <guid>https://dev.to/smrgrg/how-to-duplicate-an-existing-zoho-configuration-to-a-new-account-3d8</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--g38KXXhZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AzorM-70hlMMKEBrs" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--g38KXXhZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AzorM-70hlMMKEBrs" alt=""&gt;&lt;/a&gt;Photo by &lt;a href="https://unsplash.com/@2mduffel?utm_source=medium&amp;amp;utm_medium=referral"&gt;Mark Duffel&lt;/a&gt; on &lt;a href="https://unsplash.com?utm_source=medium&amp;amp;utm_medium=referral"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Copying existing configuration from current Zoho account to a new one is termed as &lt;strong&gt;Copying Customization&lt;/strong&gt; in Zoho. According to Zoho’s knowledge base:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Copying Customization&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Larger companies with multiple branches or services may require multiple CRM accounts. However, the core requirements remains the same for each CRM. Hence companies do not want to waste time cutomizing each CRM account individually. Zoho CRM comes with a solution to this problem in the form of Copy Customization. This feature allows users to duplicate the custom settings of one CRM account into another account.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  Notes before starting
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;You can use the Copy Customization feature to copy system-level configurations to the target accounts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Permission Required:&lt;/strong&gt; Users with the Administrator profile can access this feature.&lt;/li&gt;
&lt;li&gt;Copy Customization requires having both the user accounts with same Edition. For example, you cannot copy the customizations from Professional Edition to Enterprise Edition. Both account A and B should have the same Paid Edition. Account B can also be the Trial Version of the Paid Edition.&lt;/li&gt;
&lt;li&gt;The source account should not have a company logo in the template while copying the customization. &lt;em&gt;(Don’t know why this is there.)&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;You need the User ID (email address) of the CRM account to which the customization needs to be copied.&lt;/li&gt;
&lt;li&gt;The destination account must be a new one. Copy customization does not work for older CRM accounts. No customization should be created in target account.&lt;/li&gt;
&lt;li&gt;Keep in mind that the &lt;strong&gt;data centre&lt;/strong&gt; of the source and destination both needs to be in the same region. The customization cannot be copied across different data centres. (As per their support, this can be selected while creating an account in Zoho at first. To find out in which region the account’s data centre is, we need to look at the url in the address bar. For example: &lt;a href="http://crmplus.zoho.com/"&gt;crmplus.zoho.com&lt;/a&gt; is from the US and &lt;a href="http://crmplus.zoho.com.au/"&gt;crmplus.zoho.com.au&lt;/a&gt; is from AU.)&lt;/li&gt;
&lt;li&gt;This is a one-time process and you cannot process “Copy Customization” a second time for the same customer.&lt;/li&gt;
&lt;li&gt;The values of lookup or multi-select lookup fields will not be copied from the source to the destination account.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Process Copy Customization
&lt;/h3&gt;

&lt;p&gt;The Copy Customization feature helps organizations get the same custom settings across all their CRM accounts with reduced effort and time. The Zoho CRM user will need to specify the User ID (email address) of the CRM account to which the customization needs to be copied. With this feature, you can copy the various customizations that include Fields, Sections, Page Layouts, Tabs, Custom Reports, Email &amp;amp; Inventory Templates, and Logos.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;To process copy customization&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to &lt;strong&gt;Setup&lt;/strong&gt; &amp;gt; &lt;strong&gt;Customization&lt;/strong&gt; &amp;gt; &lt;strong&gt;Copy Customization&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;In the &lt;em&gt;Copy Customization&lt;/em&gt; page, specify the &lt;strong&gt;User Email&lt;/strong&gt; (email address) of the CRM account to which the customization needs to be copied.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Copy&lt;/strong&gt;.
An email will be sent to the Super Administrator of the target account. The Copy Customization scheduler starts only after the customer (Super Administrator) confirms the process.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; A table listing out the customizations that will be copied and the ones that will not be is shown in &lt;a href="https://help.zoho.com/portal/kb/articles/copy-customization"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Based upon my experience, copy customization is not a piece of cake and requires configurations as above to match. I will be updating the issues as I encounter more of those.&lt;/p&gt;

&lt;p&gt;Reference:&lt;a href="https://help.zoho.com/portal/kb/articles/copy-customization"&gt;https://help.zoho.com/portal/kb/articles/copy-customization&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Writer’s note: This article is an extension of the article referenced above.&lt;/em&gt;&lt;/p&gt;




</description>
      <category>copyingcustomizatio</category>
      <category>copysettings</category>
      <category>zohocrm</category>
      <category>crm</category>
    </item>
    <item>
      <title>Git push to new repo from existing repo’s branch</title>
      <dc:creator>Sameer Gurung</dc:creator>
      <pubDate>Tue, 01 Oct 2019 06:09:55 +0000</pubDate>
      <link>https://dev.to/smrgrg/git-push-to-new-repo-from-existing-repo-s-branch-25kf</link>
      <guid>https://dev.to/smrgrg/git-push-to-new-repo-from-existing-repo-s-branch-25kf</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wckPb4IN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2A6PSyAfLoxeKQNpXLA8M_Kw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wckPb4IN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2A6PSyAfLoxeKQNpXLA8M_Kw.png" alt=""&gt;&lt;/a&gt;Project setup to git push from my-project repository (repo) to new-project repo&lt;/p&gt;

&lt;p&gt;While working with multiple projects, you might have encountered a situation where you need to create a new project from existing project’s (repo) some branch. We can always do it manually by copying and pasting and uploading it to new repo.&lt;/p&gt;

&lt;p&gt;However, this is another &lt;strong&gt;“better way”&lt;/strong&gt; to achieve this, with the help of git itself.&lt;/p&gt;

&lt;h4&gt;
  
  
  Lets start by adding new remote repository into existing git project:
&lt;/h4&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt; **Go to current project:** 

$ cd my-project

**List current remote:** 

$ git remote -v
originhttps://github.com/my-org/my-project (fetch)
originhttps://github.com/my-org/my-project (push)

**Add new origin (origin2): git remote add origin2 &amp;lt;git\_url&amp;gt;**

$ git remote add origin2 https://github.com/my-org/new-project

(By default, git uses origin, so lets add new origin as origin2)

**Lets see recently added origin:** 

$ git remote -v
originhttps://github.com/my-org/my-project (fetch)
originhttps://github.com/my-org/my-project (push)
origin2 [https://github.com/my-org/new-project](https://github.com/my-org/new-project) (fetch)
origin2 [https://github.com/my-org/new-project](https://github.com/my-org/new-project) (push)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h4&gt;
  
  
  Pushing ‘master’ branch to the new repository:
&lt;/h4&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;The following command pushes master branch of current repo to master branch of new repo with remote configured as origin2.

**$ git push &amp;lt;remote\_name&amp;gt; &amp;lt;remote\_repo\_branch&amp;gt;**

$ git push origin2 master
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h4&gt;
  
  
  Pushing specific branch:
&lt;/h4&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;The following command pushes specific branch (say dev) of current repo to master branch of new repo with remote configured as origin2.

**$ git push origin2 &amp;lt;source\_branch&amp;gt;:&amp;lt;destination\_branch&amp;gt;**

$ git push origin2 dev:master

**Use --force (to forcefully push into that new branch if required)**

$ git push origin2 &amp;lt;source\_branch&amp;gt;:&amp;lt;destination\_branch&amp;gt; --force
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h4&gt;
  
  
  Removing previous commits or tracking history of current repository:
&lt;/h4&gt;

&lt;p&gt;If you want to push to the new repo without all the history of the existing repo, then you can create new orphan type branch which does not record previous history. Then push this new branch to our desired repo:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git checkout --orphan clean-branch

**Add the files and commit:**

$ git add . &amp;amp;&amp;amp; git commit -m "initial commit to new repo"

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



&lt;h4&gt;
  
  
  Push to new repository from the new clean-branch:
&lt;/h4&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;**git push origin2 &amp;lt;source\_branch&amp;gt;:&amp;lt;destination\_branch&amp;gt;**

i.e;

$ git push origin2 clean-branch:master
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Note: You can push to origin2 from new clean-branch created locally and don’t need to push this new clean-branch to server.&lt;/p&gt;

&lt;h4&gt;
  
  
  Deleting branch:
&lt;/h4&gt;

&lt;p&gt;You can delete the newly created local branch if you wish. Just checkout to a different branch than the one you want to delete and then delete using commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;**Checkout another branch:**

$ git checkout master

**Delete the newly created branch:**

$ git branch -D clean-branch
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;






</description>
      <category>versioncontrol</category>
      <category>copyexistingreposi</category>
      <category>createnewrepositor</category>
      <category>git</category>
    </item>
  </channel>
</rss>
