<?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>Forem: saurabh satapathy</title>
    <description>The latest articles on Forem by saurabh satapathy (@saurabh190802).</description>
    <link>https://forem.com/saurabh190802</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%2F841984%2Fd8221256-aa20-4003-bdd8-8f8de2cae094.jpeg</url>
      <title>Forem: saurabh satapathy</title>
      <link>https://forem.com/saurabh190802</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/saurabh190802"/>
    <language>en</language>
    <item>
      <title>An Easy Guide to Publishing npm packages</title>
      <dc:creator>saurabh satapathy</dc:creator>
      <pubDate>Fri, 01 Jul 2022 09:14:45 +0000</pubDate>
      <link>https://forem.com/saurabh190802/an-easy-guide-to-publishing-npm-packages-2ili</link>
      <guid>https://forem.com/saurabh190802/an-easy-guide-to-publishing-npm-packages-2ili</guid>
      <description>&lt;p&gt;Anyone who has worked in JavaScript frameworks knows what a npm package is? And how important it is? So, what's your thought on publishing your own package? Ya, I know it is cool to install your own package using &lt;code&gt;npm i your_component_name&lt;/code&gt; 🤩🤩. All these things are very meaningful to a beginner. It will definitely bring a smile on your face 😇.&lt;/p&gt;

&lt;p&gt;Here, We are going to see some easy steps through which you can publish your npm package. For this first you have to build a component that you want to publish. After successfully creating a component just follow the below steps.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Keep all required files of your component in a single folder let assume it is named as component. 
&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%2Fuax8i6g1sswt8pob0xck.png" alt="component folder inside a folder"&gt;
(⚠️All required files of your component must be inside the component folder)&lt;/li&gt;
&lt;/ul&gt;



&lt;ul&gt;
&lt;li&gt;Now create a index.js file inside this. Refer below image 👇&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%2Fl1lgbhfngj5q4e9izqkd.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%2Fl1lgbhfngj5q4e9izqkd.png" alt="creating index.js"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Now, just import and export your component in index.js file like this 👇
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import your_component_name from './component/your_component_name'
export default your_component_name;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;(Or, just open this folder with vs code, create a new file named index.js, write these two lines and save it.)&lt;br&gt;
⚠️Replace your_component_name with your component name.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;If you don't have an npm account just goto npm on your browser and sign up. &lt;a href="https://www.npmjs.com/signup" rel="noopener noreferrer"&gt;click here to sign up with npm&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Open cmd with in the same folder. Easy way just write cmd at place of your folders path and click enter. Refer below 👇&lt;/p&gt;&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%2Fr83vvhfpg9p5j34e1ol3.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%2Fr83vvhfpg9p5j34e1ol3.png" alt="opening cmd with in the same folder"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Login to npm by this command &lt;code&gt;npm add user&lt;/code&gt;&lt;br&gt;
(It will ask your usename, password and email just give and log your self in)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Now run this command &lt;code&gt;npm init&lt;/code&gt;&lt;br&gt;
It will ask package name, version, description, entry point, test command, git repository (if your component is in your git then give the repository link), keywords (these keywords are helpful for showing your package name in npm search), author (give like this your_name &amp;lt; your email id &amp;gt; ) and license ("MIT" or "ISC" which you like), then write yes and click enter.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;After the above you can see your package.json created over there.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If you have used any third party library then just install them here by which all of these will listed as dependency in your package.json which will help user to get everything installed by a single npm install.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Now, create a readme.md describing your component which will be shown in npm.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Go back to cmd and run &lt;code&gt;npm publish&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Now, you can see your package listed in npm.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🎉🎉🎉🎉🎉&lt;br&gt;
Congratulations, you have successfully published your npm package.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.npmjs.com/~saurabh19" rel="noopener noreferrer"&gt;Link to my npm packages&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thank you&lt;/p&gt;

&lt;p&gt;Ways to reach me: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;LinkedIn: &lt;a href="https://www.linkedin.com/in/saurabh-satapathy-692a6a1b9/" rel="noopener noreferrer"&gt;saurabh satapathy&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Twitter: &lt;a href="https://twitter.com/SaurabhSatapat1" rel="noopener noreferrer"&gt;SaurabhSatapat1&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/saurabh190802" rel="noopener noreferrer"&gt;saurabh190802&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Email: &lt;a href="mailto:saurabhsatapathy0@gmail.com"&gt;saurabhsatapathy0@gmail.com&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>npm</category>
      <category>javascript</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>Developing &amp; Publishing a Web Extension (Beginner's Guide)</title>
      <dc:creator>saurabh satapathy</dc:creator>
      <pubDate>Thu, 30 Jun 2022 14:33:54 +0000</pubDate>
      <link>https://forem.com/saurabh190802/developing-publishing-a-web-extension-beginners-guide-42na</link>
      <guid>https://forem.com/saurabh190802/developing-publishing-a-web-extension-beginners-guide-42na</guid>
      <description>&lt;p&gt;&lt;strong&gt;Web Extension&lt;/strong&gt; - Is not this term fascinating? Ya, I know the term chrome extension has dominated and we all are more fascinated to that. We all know about chrome web store and chrome extensions. But there is one more Browser &lt;strong&gt;Mozilla Firefox&lt;/strong&gt; which is also widely popular but some of us are not aware about &lt;strong&gt;ADD-ONS&lt;/strong&gt;. We can do the same thing here in ADD-ONS what you are doing there in chrome extensions. Building a chrome extension and a mozilla add-on is quite similar. So here we are going to see what is a web extension and simultaneously we will build a simple extension and see the publishing procedure for both chrome web store and mozilla add-ons.&lt;/p&gt;

&lt;h2&gt;
  
  
  What’s Web Extension?
&lt;/h2&gt;

&lt;p&gt;From a technical perspective, a Web Extension is just some CSS, HTML, and JavaScript that enables the user to add functionality into the Web Browser through some API. The extension components include content scripts, background scripts, an options page, Logic files, and various UI elements. An extension’s component relies on its functionality and may or may not require every option. &lt;br&gt;
The difference between a Web Extension and an application is that they are often easier to build &amp;amp; deploy as they are centered around a singular function. &lt;/p&gt;
&lt;h2&gt;
  
  
  Creating Your First Extension
&lt;/h2&gt;

&lt;p&gt;Here you are going to build and publish a extension which will generate a new quote each time.&lt;/p&gt;
&lt;h3&gt;
  
  
  Creating manifest.json
&lt;/h3&gt;

&lt;p&gt;Every extension contains a JSON-formatted manifest file, named manifest.json. Browser uses this file to acquire certain pieces of information about the extension you are going to develop. It is very important.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    "name": "Your_Extension_name",
    "version": "0.0.1",
    "manifest_version": 3,
    "action": {
        "default_popup": "popup.html",
        "default_icon": "logo.png"
    },
    "icons": {
        "128": "logo.png"
    },
    "permissions": ["activeTab"]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Creating popup.html
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html lang="en"&amp;gt;
  &amp;lt;head&amp;gt;
    &amp;lt;meta charset="UTF-8" /&amp;gt;
    &amp;lt;meta http-equiv="X-UA-Compatible" content="IE=edge" /&amp;gt;
    &amp;lt;meta name="viewport" content="width=device-width, initial-scale=1.0" /&amp;gt;
    &amp;lt;link rel="stylesheet" href="style.css" /&amp;gt;
    &amp;lt;title&amp;gt;your_package_name&amp;lt;/title&amp;gt;
  &amp;lt;/head&amp;gt;
  &amp;lt;body&amp;gt;
    &amp;lt;p id="quoteElement"&amp;gt;Loading...&amp;lt;/p&amp;gt;
    &amp;lt;script src="script.js"&amp;gt;&amp;lt;/script&amp;gt;
  &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Creating script.js
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fetch("http://api.quotable.io/random")
  .then((data) =&amp;gt; data.json())
  .then((quoteData) =&amp;gt; {
    const quoteText = quoteData.content;
    const quoteElement = document.getElementById("quoteElement");

    quoteElement.innerHTML = quoteText;
  });
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here we are using an api for generating a new quote each time.&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating styles.css
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;body {
    width: 300px;
    height: 300px;
    background-image: linear-gradient(to right, #434343 0%, black 100%);
    display:flex;
    justify-content: center;
}

p {
    display: inner-flex;
    margin: auto 10px;
    font-size: 22px;
    color: #ffffff;
    border-width: 3px;
        border-style: solid;
        border-image:
            linear-gradient(to bottom,
                red,
                rgba(0, 0, 0, 0)) 1 100%;

    padding: 10px;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Testing
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Now, go to Manage Extensions in Chrome Browser.&lt;/li&gt;
&lt;li&gt;Turn Developer Mode on.&lt;/li&gt;
&lt;li&gt;Click on Load Unpacked (situated at top left).&lt;/li&gt;
&lt;li&gt;Select your extension's manifest.json file.&lt;/li&gt;
&lt;li&gt;Now, you can see your extension listed here.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Publishing on Chrome Web Store
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;For publishing the extension in Chrome Web Store, one needs to have a developer account. There is a one-time sign up fee of $5 to publish your extensions. With this account, you can publish as much as 20 extensions in Chrome Store. After successful sign up, the next step is to log in to your developer’s account and go to your developer’s dashboard.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;There you will come across the “Add New Button” button which will redirect you to a page to upload a ZIP file. Don’t forget to create a Zip file beforehand of your folder directory comprising of JSON and JavaScript files.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Upload your Zip package, and give a relevant description of your extension. Please make sure that you clearly explain the singular function of your extension. Moreover, you can also give Screenshots and a YouTube tutorial video to guide your users, on how to interact with your plugin.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You can also edit the icons of your extension and configure your extension at any point of time. To see how everything you configured will look on Chrome Web store, preview the changes. If everything goes smoothly, hit “Publish.”&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Publishing as Mozilla ADD-ON
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;First, zip your extension, keeping manifest.json as root.&lt;/li&gt;
&lt;li&gt;Open your Firefox Browser and search mozilla add-ons or &lt;a href="https://addons.mozilla.org/en-US/firefox/" rel="noopener noreferrer"&gt;click on this link&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Then sign up create a new account or log yourself in if you already have an account. Now, got to Developer Hub (link situated at the top right)&lt;/li&gt;
&lt;li&gt;Click on Submit a New Add-on. On the next screen, click on this site and continue.&lt;/li&gt;
&lt;li&gt;Noe click on select file and choose your zip file. After upload a series of automated validation tests will be run on your file.&lt;/li&gt;
&lt;li&gt;On the next screen, click yes if you want to share source code otherwise click no then continue.&lt;/li&gt;
&lt;li&gt;Then describe your Add-On.&lt;/li&gt;
&lt;li&gt;After successful submission wait for some hours. Your Add-On will be listed after review (You will also get notified by mail for the same).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Congratulations, You have successfully developed and published your first extension.&lt;/p&gt;

&lt;h3&gt;
  
  
  This will look like this
&lt;/h3&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%2Fx3b954pyparnhkixzei9.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%2Fx3b954pyparnhkixzei9.png" alt="qoto - Mozilla ADD-ON"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://addons.mozilla.org/en-US/firefox/addon/qoto/" rel="noopener noreferrer"&gt;Link to download &lt;strong&gt;qoto&lt;/strong&gt;. Download it and stay motivated.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thank you&lt;/p&gt;

&lt;p&gt;Ways to reach me: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;LinkedIn: &lt;a href="https://www.linkedin.com/in/saurabh-satapathy-692a6a1b9/" rel="noopener noreferrer"&gt;saurabh satapathy&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Twitter: &lt;a href="https://twitter.com/SaurabhSatapat1" rel="noopener noreferrer"&gt;SaurabhSatapat1&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/saurabh190802" rel="noopener noreferrer"&gt;saurabh190802&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Email: &lt;a href="mailto:saurabhsatapathy0@gmail.com"&gt;saurabhsatapathy0@gmail.com&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>webextension</category>
      <category>beginners</category>
      <category>javascript</category>
      <category>html</category>
    </item>
  </channel>
</rss>
