<?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: Mayank Kumar</title>
    <description>The latest articles on DEV Community by Mayank Kumar (@mank42).</description>
    <link>https://dev.to/mank42</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%2F1189976%2F551c4ad7-070c-47e2-b232-bf77cb3ac339.jpg</url>
      <title>DEV Community: Mayank Kumar</title>
      <link>https://dev.to/mank42</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mank42"/>
    <language>en</language>
    <item>
      <title>How I created a npm library, published it in a day?</title>
      <dc:creator>Mayank Kumar</dc:creator>
      <pubDate>Thu, 07 Dec 2023 14:33:02 +0000</pubDate>
      <link>https://dev.to/mank42/how-i-created-a-npm-library-published-it-in-a-day-9b2</link>
      <guid>https://dev.to/mank42/how-i-created-a-npm-library-published-it-in-a-day-9b2</guid>
      <description>&lt;p&gt;Hello reader, &lt;br&gt;
So you are interested in publishing your own library on &lt;a href="https://www.npmjs.com/package/mernkit?activeTab=readme"&gt;npm&lt;/a&gt;? Or just trying to gain an insight on how it could be done, so yes it's very logical to try it out and was fun for me.&lt;/p&gt;

&lt;p&gt;Any interviews/events or meet-up, have something to show your work, and move around like Simba, Pumba and Timoth 😂.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XsmvMhb0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hquinrcn0k1rx496fmqu.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XsmvMhb0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hquinrcn0k1rx496fmqu.gif" alt="Trio Lion King" width="498" height="280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Try this command which will give you more insights to my library, and open to any addition to the libray!!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx mernkit your-project
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you want to learn more about this library, one click to check it all(2 mins read!), &lt;a href="https://www.npmjs.com/package/mernkit?activeTab=readme"&gt;mernkit&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's start with how I got it done quickly,&lt;/p&gt;

&lt;h2&gt;
  
  
  Ideation (1/5✅)
&lt;/h2&gt;

&lt;p&gt;I wanted to have a proper folder structure for my MERN projects. Industry requires you to use MVC structure and it's good to get early with these habits.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---IMUV4Ly--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1dupguikd9yglo171zzm.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---IMUV4Ly--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1dupguikd9yglo171zzm.gif" alt="Timon" width="498" height="317"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Starting to work on it (2/5✅)
&lt;/h2&gt;

&lt;p&gt;So firstly I created a folder structure with the basic ideation as this,&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5696ECLf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b8b9nna57fn0rk85w6qj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5696ECLf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b8b9nna57fn0rk85w6qj.png" alt="Front-end for MERN project" width="775" height="469"&gt;&lt;/a&gt;&lt;br&gt;
I needed Vite.js, React Routers, Tailwind CSS for front-end&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--I172OYmI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b2r9c6myx3v3akelv687.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--I172OYmI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b2r9c6myx3v3akelv687.png" alt="Back-end for MERN project" width="690" height="433"&gt;&lt;/a&gt;&lt;br&gt;
Then model, controllers, routes, config.js, .env folder and thug get a proper structure. &lt;/p&gt;

&lt;p&gt;Then coded it all out, giving u my &lt;a href="https://github.com/mank-423/MernKit"&gt;GitHub&lt;/a&gt; repo, the templates folder holds all my code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1Lk5d2RH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ygl6pnijry6ng85fh5sm.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1Lk5d2RH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ygl6pnijry6ng85fh5sm.jpg" alt="Pumba" width="380" height="282"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Work on library structure (3/5✅)
&lt;/h2&gt;

&lt;p&gt;Searched out on how to connect to npm with "&lt;em&gt;npm login&lt;/em&gt;", and use your code to make a library, you can keep the logic as running just a single function or multiple. Then I looked on youtube and got one simple video of &lt;a href="https://www.youtube.com/watch?v=J4b_T-qH3BY"&gt;Web Dev Simplified&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Now keeping a script.js to make the library. This script.js will run and handle logical part of your library.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;!/usr/bin/env node
const fs = require('fs');
const path = require('path');
const projectName = process.argv[2] || 'my-mern-project';
const projectPath = path.join(process.cwd(), projectName);
async function copyDir(src, dest) {
  await fs.promises.mkdir(dest, { recursive: true });
  let entries = await fs.promises.readdir(src, { withFileTypes: true });
  for (let entry of entries) {
    let srcPath = path.join(src, entry.name);
    let destPath = path.join(dest, entry.name);
    entry.isDirectory() ?
      await copyDir(srcPath, destPath) :
      await fs.promises.copyFile(srcPath, destPath);
  }
}
async function copyTemplates() {
  try {
    const scriptDir = path.resolve(__dirname);
    await Promise.all([copyDir(path.join(scriptDir, '../templates/frontend'), path.join(projectPath, 'frontend')),
      copyDir(path.join(scriptDir, '../templates/backend'), path.join(projectPath, 'backend'))
    ]);
    console.log('mernkit setup completed successfully!');
  } catch (error) {
    console.error('Error copying templates:', error);
  }
}
copyTemplates();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Testing!!(Very Important) (4/5✅)
&lt;/h2&gt;

&lt;p&gt;While being in the root of project directory, "&lt;em&gt;npm link&lt;/em&gt;", this links your library to test, create a new test folder and try to run the command to check your library.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XbJ0sDss--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z3a02ph5yewo6y8vx6b5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XbJ0sDss--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z3a02ph5yewo6y8vx6b5.png" alt="Testing" width="522" height="494"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Just because I didn't test my library well, I had to release version 1.0.0 to 1.0.7 to get a working library, not advisable so test it out well, and also get Read.me done.&lt;/p&gt;

&lt;h2&gt;
  
  
  Publish it!! (5/5✅)
&lt;/h2&gt;

&lt;p&gt;Use the command, to publish your library/package to npm.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;A basic 5 step method to get your own library and show your work to people apart from your GitHub, something which is live and open to people to use. &lt;/p&gt;

&lt;p&gt;Now after you have published your package, it's time to relax, u have just made your first library just like me....&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--AZjaydoC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xp444fgmqkaia77df5vi.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--AZjaydoC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xp444fgmqkaia77df5vi.gif" alt="Simba" width="414" height="208"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hit me up on my socials for any discussions,&lt;br&gt;
&lt;a href="https://instagram.com/mank_42"&gt;Instagram-mank_42&lt;/a&gt;&lt;br&gt;
&lt;a href="https://twitter.com/okaymank"&gt;Twitter-okaymank&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.linkedin.com/in/mayank-kumar42/"&gt;Linked-In-Mayank Kumar&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/mank-423"&gt;Github-mank-423&lt;/a&gt;&lt;/p&gt;

</description>
      <category>mern</category>
      <category>javascript</category>
      <category>npm</category>
      <category>react</category>
    </item>
    <item>
      <title>Don't do this in your tech interviews!!(My learnings so far...)</title>
      <dc:creator>Mayank Kumar</dc:creator>
      <pubDate>Thu, 30 Nov 2023 09:22:46 +0000</pubDate>
      <link>https://dev.to/mank42/dont-do-this-in-your-tech-interviewsmy-learnings-so-far-3eod</link>
      <guid>https://dev.to/mank42/dont-do-this-in-your-tech-interviewsmy-learnings-so-far-3eod</guid>
      <description>&lt;p&gt;Let's keep it short and simple about what are my learnings from the interviews I have given so far in the year of 2023. I will also share my small moments throughout on every aspect.&lt;/p&gt;

&lt;p&gt;First of all, Hi from Mayank and Stitch which will be with you throughout the post. Dev.to.&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%2Fv3iuyhr8c8mjzpbdphxc.gif" 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%2Fv3iuyhr8c8mjzpbdphxc.gif" alt="Hi from stitch"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So I have given Interview for SDE and MERN developer roles, and here are the learnings:&lt;/p&gt;

&lt;h2&gt;
  
  
  Know your language
&lt;/h2&gt;

&lt;p&gt;Always have enough hands-on with the language and look-up for common built-ins used in the language. Also getting comfortable with a web editor helps during interview.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Funny story: Somewhere in March 2k23, I was interviewed for full-stack MERN. And the conversation was like,&lt;br&gt;
Interviewer: How would you rate yourself in JavaScript?&lt;br&gt;
Me: Out of 5 or 10? (confidence 😂)&lt;br&gt;
Interviewer: Out of 5 (and I said 4!!)&lt;br&gt;
After that it started with array declaration and then bombarding of inbuilt of js which I seriously didn't prepared for and I don't know how I made through the interview 🫠. My mistake totally!&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Don't jump to tutorials and feel you are ready!
&lt;/h2&gt;

&lt;p&gt;I have changed my approach, now I try one good tutorial create a codebase, after that I use that codebase and try to create my own logic for a very basic app to just learn the functionality.&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%2Fvgyzzuq2tb4sayh6ljzo.gif" 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%2Fvgyzzuq2tb4sayh6ljzo.gif" alt="Stitch walking to interview"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Use Chat-GPT to get idea and code structure but try to type the code on your own
&lt;/h2&gt;

&lt;p&gt;A serious one!, I have seen myself indulging in GPT usage this much, that I could just know how to use any code but I had problem typing it out. Get your syntax perfect even just knowing what to type, simply copy-pasting is not useful.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;One more on Reactjs interview, I easily made a form with useState to show the values, unless asked to make a array in useState and insert the values in array. I was blank with syntax, but slowly keeping myself calm, I was able to complete it with interviewer's help. Also the above interview(js-4/5), I was asked to make a drop-down, which I hadn't used it in a while, there also I was stuck. So get the syntax straight!!&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Always be prepared with a polished introduction (*basic communication tip)
&lt;/h2&gt;

&lt;p&gt;I still sometimes forget some part of introduction, but all-in-all it should give the idea of who you are, what you are doing and learning, your project ideas and why applied for this role. Also adding some relevant experience is a plus. *I stammered in my first HR interview when she directly asked 'So tell me about yourself'😝.&lt;/p&gt;

&lt;h2&gt;
  
  
  Look for basic questions of interview(GFG, InterviewBit, etc.)
&lt;/h2&gt;

&lt;p&gt;Concepts like hoisting, fork process, sharding, event callback flow, asynchronous programming, and small topics like this, I hadn't perfect idea before a Node.js Intern Developer role and some basic JavaScript concepts. Kind interviewer explained me every concept clearly *live tutorial 🌟, ofc didn't made it😂. &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%2Fcay2u71t3wr321tz5j0q.gif" 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%2Fcay2u71t3wr321tz5j0q.gif" alt="Learn stitch!"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Make small projects on concepts and put everything on GitHub
&lt;/h2&gt;

&lt;p&gt;Got this tip from recent interview to just type-out and keep ready small projects on topics i.e.- OOPS concept, basic CRUD apps, Redux Implementation(Make a to-do list, or just basic input and showing data on webpage) / Context API, and push all the code on GitHub to showcase them instantly.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;I just tried giving a .NET full-stack dev interview, because HR explained that basically it's related to front-end development for freshers. Oh my God! I jotted down basics of .NET core, MVC, hands on C# language, ASP.NET and some other concepts. The interviewer directly started with any project implementations on OOPS in C#🤣. I explained the concepts but I didn't had any projects. So yes, didn't got the role. Ofccc🤔&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So it ends with a condensed part which I also follow,&lt;strong&gt;&lt;em&gt;Know what you are doing, Keep proof of work, and stay calm!. That's it&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Hit me up on my socials for discussing any stories or any project ideas,&lt;br&gt;
&lt;a href="https://instagram.com/mank_42" rel="noopener noreferrer"&gt;Instagram-mank_42&lt;/a&gt;&lt;br&gt;
&lt;a href="https://twitter.com/okaymank" rel="noopener noreferrer"&gt;Twitter-okaymank&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.linkedin.com/in/mayank-kumar42/" rel="noopener noreferrer"&gt;Linked-In-Mayank Kumar&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/mank-423" rel="noopener noreferrer"&gt;Github-mank-423&lt;/a&gt;&lt;/p&gt;

</description>
      <category>learning</category>
      <category>interview</category>
      <category>coding</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
