<?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: Anish Prashun</title>
    <description>The latest articles on DEV Community by Anish Prashun (@anishpras).</description>
    <link>https://dev.to/anishpras</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%2F542223%2F3bc4cdcf-7829-4adc-ba0f-02634d93e9d3.jpeg</url>
      <title>DEV Community: Anish Prashun</title>
      <link>https://dev.to/anishpras</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/anishpras"/>
    <language>en</language>
    <item>
      <title>How to create and publish a TypeScript package.</title>
      <dc:creator>Anish Prashun</dc:creator>
      <pubDate>Sun, 06 Feb 2022 12:47:55 +0000</pubDate>
      <link>https://dev.to/anishpras/how-to-create-and-publish-a-typescript-package-1nli</link>
      <guid>https://dev.to/anishpras/how-to-create-and-publish-a-typescript-package-1nli</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In this guide, we will build a package for generating currency symbols from their respective &lt;br&gt;
currency code using typescript and publish it as a &lt;strong&gt;Node.js&lt;/strong&gt; package.&lt;/p&gt;

&lt;p&gt;This is what we are going to build:&lt;br&gt;
&lt;a href="https://www.npmjs.com/package/currency-symbol-generator"&gt;Currency-symbols-generator NPM&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/Anishpras/currency-symbol-generator#readme"&gt;Github Repo&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Alright.Let's get started!
&lt;/h2&gt;

&lt;p&gt;Make sure you have the latest version of node and npm.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node -v
v16.13.2

npm -v
8.1.2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Pick a great name
&lt;/h2&gt;

&lt;p&gt;This is probably harder than you think. The package name must be Pascal Case and lowercase. With over 1,800,000 packages, do a quick search at &lt;a href="https://www.npmjs.com/"&gt;https://www.npmjs.com/&lt;/a&gt; to make sure your name isn't used yet. In this guide, we'll choose the name currency-symbol-generator, but make sure to use a &lt;strong&gt;unique name&lt;/strong&gt; so you can publish the package, later on, npm 🚀.&lt;/p&gt;

&lt;h2&gt;
  
  
  Open you workspace where you want to create your package
&lt;/h2&gt;

&lt;p&gt;In this we will be using our Desktop directory&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd Desktop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Let's initialise our Package
&lt;/h2&gt;

&lt;p&gt;We will be using &lt;a href="https://tsdx.io/"&gt;TSDX&lt;/a&gt; in this guide as it provides all the necessary dependencies. You can change the name &lt;strong&gt;&lt;em&gt;currency-symbol-generator&lt;/em&gt;&lt;/strong&gt; to your own package name, as it will generate a package.json with the same name.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx tsdx create currency-symbol-generator
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;choose &lt;strong&gt;basic&lt;/strong&gt; option when asked in the terminal and press enter.&lt;/p&gt;

&lt;p&gt;Then change your directory to the package folder.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd currency-symbol-generator
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt; - Be sure to use the name as specified while creating the package using tsdx.&lt;/p&gt;

&lt;h2&gt;
  
  
  Create a git repository
&lt;/h2&gt;

&lt;p&gt;All in order. You need a remote git repository for the package so you can download it. Creating a remote Git repository isn't relevant to this article, but once you've created it, you can use the following lines to initialise your local repository and set up a remote origin.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git init
echo "# Currency Symbol Generator" &amp;gt;&amp;gt; README.md
git add . &amp;amp;&amp;amp; git commit -m "Initial commit"
git branch -M main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace  with the URL to your remote repository.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git remote add origin &amp;lt;Git Repository Url&amp;gt;
git push -u origin main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Modify your package.json
&lt;/h2&gt;

&lt;p&gt;Add &lt;strong&gt;author&lt;/strong&gt;, &lt;strong&gt;description&lt;/strong&gt;, &lt;strong&gt;keywords&lt;/strong&gt;, &lt;strong&gt;repository&lt;/strong&gt; and &lt;strong&gt;bugs&lt;/strong&gt; key in &lt;strong&gt;&lt;em&gt;package.json&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Your package.json should look like this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "author": "Anish Prashun &amp;lt;anishprashun118@gmail.com",
  "version": "0.1.0",
  "license": "MIT",
  "description": "A minimal package for getting symbol of a currency using the country code.",
  "keywords": [
    "currency",
    "symbol",
    "react",
    "typescript",
    "javascript",
    "currency symbol",
    "get currency symbol",
    "anish prashun"
  ],
  "main": "dist/index.js",
  "typings": "dist/index.d.ts",
  "files": [
    "dist",
    "src"
  ],
  "repository": {
    "type": "git",
    "url": "https://github.com/Anishpras/currency-symbol-generator",
    "directory": "/"
  },
  "bugs": {
    "url": "https://github.com/Anishpras/currency-symbol-generator/issues"
  },
  "engines": {
    "node": "&amp;gt;=10"
  },
  "scripts": {
    "start": "tsdx watch",
    "build": "tsdx build",
    "test": "tsdx test",
    "lint": "tsdx lint",
    "prepare": "tsdx build",
    "size": "size-limit",
    "analyze": "size-limit --why"
  },
  "peerDependencies": {},
  "husky": {
    "hooks": {
      "pre-commit": "tsdx lint"
    }
  },
  "prettier": {
    "printWidth": 80,
    "semi": true,
    "singleQuote": true,
    "trailingComma": "es5"
  },
  "name": "currency-symbol-generator",
  "module": "dist/currency-symbol-generator.esm.js",
  "size-limit": [
    {
      "path": "dist/currency-symbol-generator.cjs.production.min.js",
      "limit": "10 KB"
    },
    {
      "path": "dist/currency-symbol-generator.esm.js",
      "limit": "10 KB"
    }
  ],
  "devDependencies": {
    "@size-limit/preset-small-lib": "^7.0.5",
    "husky": "^7.0.4",
    "size-limit": "^7.0.5",
    "tsdx": "^0.14.1",
    "tslib": "^2.3.1",
    "typescript": "^4.5.4"
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt; - Change the details according to your need, like change the author name to your name and respectively.&lt;/p&gt;

&lt;h2&gt;
  
  
  Let's get to the real code now.
&lt;/h2&gt;

&lt;p&gt;Create a &lt;strong&gt;currencyList.ts&lt;/strong&gt; under &lt;strong&gt;&lt;em&gt;src&lt;/em&gt;&lt;/strong&gt; folder and create a array that contains all the symbols respective to their currency code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const currencyList = [
  { name: 'AED', symbol: 'د.إ' },
  { name: 'AFN', symbol: '؋' },
  { name: 'ALL', symbol: 'L' },
  { name: 'AMD', symbol: '֏' },
  { name: 'ANG', symbol: 'ƒ' },
  { name: 'AOA', symbol: 'Kz' },
  { name: 'ARS', symbol: '$' },
  { name: 'AUD', symbol: '$' },
  { name: 'AWG', symbol: 'ƒ' },
  { name: 'AZN', symbol: '₼' },
  { name: 'BAM', symbol: 'KM' },
  { name: 'BBD', symbol: '$' },
  { name: 'BDT', symbol: '৳' },
  { name: 'BGN', symbol: 'лв' },
  { name: 'BHD', symbol: '.د.ب' },
  { name: 'BIF', symbol: 'FBu' },
  { name: 'BMD', symbol: '$' },
  { name: 'BND', symbol: '$' },
  { name: 'BOB', symbol: '$b' },
  { name: 'BRL', symbol: 'R$' },
  { name: 'BSD', symbol: '$' },
  { name: 'BTC', symbol: '฿' },
  { name: 'BTN', symbol: 'Nu.' },
  { name: 'BWP', symbol: 'P' },
  { name: 'BYR', symbol: 'Br' },
  { name: 'BYN', symbol: 'Br' },
  { name: 'BZD', symbol: 'BZ$' },
  { name: 'CAD', symbol: '$' },
  { name: 'CDF', symbol: 'FC' },
  { name: 'CHF', symbol: 'CHF' },
  { name: 'CLP', symbol: '$' },
  { name: 'CNY', symbol: '¥' },
  { name: 'COP', symbol: '$' },
  { name: 'CRC', symbol: '₡' },
  { name: 'CUC', symbol: '$' },
  { name: 'CUP', symbol: '₱' },
  { name: 'CVE', symbol: '$' },
  { name: 'CZK', symbol: 'Kč' },
  { name: 'DJF', symbol: 'Fdj' },
  { name: 'DKK', symbol: 'kr' },
  { name: 'DOP', symbol: 'RD$' },
  { name: 'DZD', symbol: 'دج' },
  { name: 'EEK', symbol: 'kr' },
  { name: 'EGP', symbol: '£' },
  { name: 'ERN', symbol: 'Nfk' },
  { name: 'ETB', symbol: 'Br' },
  { name: 'ETH', symbol: 'Ξ' },
  { name: 'EUR', symbol: '€' },
  { name: 'FJD', symbol: '$' },
  { name: 'FKP', symbol: '£' },
  { name: 'GBP', symbol: '£' },
  { name: 'GEL', symbol: '₾' },
  { name: 'GGP', symbol: '£' },
  { name: 'GHC', symbol: '₵' },
  { name: 'GHS', symbol: 'GH₵' },
  { name: 'GIP', symbol: '£' },
  { name: 'GMD', symbol: 'D' },
  { name: 'GNF', symbol: 'FG' },
  { name: 'GTQ', symbol: 'Q' },
  { name: 'GYD', symbol: '$' },
  { name: 'HKD', symbol: '$' },
  { name: 'HNL', symbol: 'L' },
  { name: 'HRK', symbol: 'kn' },
  { name: 'HTG', symbol: 'G' },
  { name: 'HUF', symbol: 'Ft' },
  { name: 'IDR', symbol: 'Rp' },
  { name: 'ILS', symbol: '₪' },
  { name: 'IMP', symbol: '£' },
  { name: 'INR', symbol: '₹' },
  { name: 'IQD', symbol: 'ع.د' },
  { name: 'IRR', symbol: '﷼' },
  { name: 'ISK', symbol: 'kr' },
  { name: 'JEP', symbol: '£' },
  { name: 'JMD', symbol: 'J$' },
  { name: 'JOD', symbol: 'JD' },
  { name: 'JPY', symbol: '¥' },
  { name: 'KES', symbol: 'KSh' },
  { name: 'KGS', symbol: 'лв' },
  { name: 'KHR', symbol: '៛' },
  { name: 'KMF', symbol: 'CF' },
  { name: 'KPW', symbol: '₩' },
  { name: 'KRW', symbol: '₩' },
  { name: 'KWD', symbol: 'KD' },
  { name: 'KYD', symbol: '$' },
  { name: 'KZT', symbol: 'лв' },
  { name: 'LAK', symbol: '₭' },
  { name: 'LBP', symbol: '£' },
  { name: 'LKR', symbol: '₨' },
  { name: 'LRD', symbol: '$' },
  { name: 'LSL', symbol: 'M' },
  { name: 'LTC', symbol: 'Ł' },
  { name: 'LTL', symbol: 'Lt' },
  { name: 'LVL', symbol: 'Ls' },
  { name: 'LYD', symbol: 'LD' },
  { name: 'MAD', symbol: 'MAD' },
  { name: 'MDL', symbol: 'lei' },
  { name: 'MGA', symbol: 'Ar' },
  { name: 'MKD', symbol: 'ден' },
  { name: 'MMK', symbol: 'K' },
  { name: 'MNT', symbol: '₮' },
  { name: 'MOP', symbol: 'MOP$' },
  { name: 'MRO', symbol: 'UM' },
  { name: 'MRU', symbol: 'UM' },
  { name: 'MUR', symbol: '₨' },
  { name: 'MVR', symbol: 'Rf' },
  { name: 'MWK', symbol: 'MK' },
  { name: 'MXN', symbol: '$' },
  { name: 'MYR', symbol: 'RM' },
  { name: 'MZN', symbol: 'MT' },
  { name: 'NAD', symbol: '$' },
  { name: 'NGN', symbol: '₦' },
  { name: 'NIO', symbol: 'C$' },
  { name: 'NOK', symbol: 'kr' },
  { name: 'NPR', symbol: '₨' },
  { name: 'NZD', symbol: '$' },
  { name: 'OMR', symbol: '﷼' },
  { name: 'PAB', symbol: 'B/.' },
  { name: 'PEN', symbol: 'S/.' },
  { name: 'PGK', symbol: 'K' },
  { name: 'PHP', symbol: '₱' },
  { name: 'PKR', symbol: '₨' },
  { name: 'PLN', symbol: 'zł' },
  { name: 'PYG', symbol: 'Gs' },
  { name: 'QAR', symbol: '﷼' },
  { name: 'RMB', symbol: '￥' },
  { name: 'RON', symbol: 'lei' },
  { name: 'RSD', symbol: 'Дин.' },
  { name: 'RUB', symbol: '₽' },
  { name: 'RWF', symbol: 'R₣' },
  { name: 'SAR', symbol: '﷼' },
  { name: 'SBD', symbol: '$' },
  { name: 'SCR', symbol: '₨' },
  { name: 'SDG', symbol: 'ج.س.' },
  { name: 'SEK', symbol: 'kr' },
  { name: 'SGD', symbol: '$' },
  { name: 'SHP', symbol: '£' },
  { name: 'SLL', symbol: 'Le' },
  { name: 'SOS', symbol: 'S' },
  { name: 'SRD', symbol: '$' },
  { name: 'SSP', symbol: '£' },
  { name: 'STD', symbol: 'Db' },
  { name: 'STN', symbol: 'Db' },
  { name: 'SVC', symbol: '$' },
  { name: 'SYP', symbol: '£' },
  { name: 'SZL', symbol: 'E' },
  { name: 'THB', symbol: '฿' },
  { name: 'TJS', symbol: 'SM' },
  { name: 'TMT', symbol: 'T' },
  { name: 'TND', symbol: 'د.ت' },
  { name: 'TOP', symbol: 'T$' },
  { name: 'TRL', symbol: '₤' },
  { name: 'TRY', symbol: '₺' },
  { name: 'TTD', symbol: 'TT$' },
  { name: 'TVD', symbol: '$' },
  { name: 'TWD', symbol: 'NT$' },
  { name: 'TZS', symbol: 'TSh' },
  { name: 'UAH', symbol: '₴' },
  { name: 'UGX', symbol: 'USh' },
  { name: 'USD', symbol: '$' },
  { name: 'UYU', symbol: '$U' },
  { name: 'UZS', symbol: 'лв' },
  { name: 'VEF', symbol: 'Bs' },
  { name: 'VND', symbol: '₫' },
  { name: 'VUV', symbol: 'VT' },
  { name: 'WST', symbol: 'WS$' },
  { name: 'XAF', symbol: 'FCFA' },
  { name: 'XBT', symbol: 'Ƀ' },
  { name: 'XCD', symbol: '$' },
  { name: 'XOF', symbol: 'CFA' },
  { name: 'XPF', symbol: '₣' },
  { name: 'YER', symbol: '﷼' },
  { name: 'ZAR', symbol: 'R' },
  { name: 'ZWD', symbol: 'Z$' },
];

export default currencyList;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, Open &lt;strong&gt;index.ts&lt;/strong&gt; under &lt;strong&gt;&lt;em&gt;src/index.ts&lt;/em&gt;&lt;/strong&gt; from the root.&lt;/p&gt;

&lt;p&gt;And change the code from&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export const sum = (a: number, b: number) =&amp;gt; {
  if ('development' === process.env.NODE_ENV) {
    console.log('boop');
  }
  return a + b;
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;to&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import currencyList from './currencyList';

export const getCurrencySymbol = (currencyCode: string) =&amp;gt; {
  if (
    currencyCode === '' ||
    currencyCode === undefined ||
    currencyCode === null ||
    currencyCode === ' '
  ) {
    console.log('Enter a valid currency code');
  } else {
    for (let i = 0; i &amp;lt; currencyList.length; i++) {
      if (currencyList[i].name === currencyCode) {
        return currencyList[i].symbol;
      }
    }
  }
};

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

&lt;/div&gt;



&lt;p&gt;Lets understand what are we really doing, we are importing the &lt;strong&gt;currencyList&lt;/strong&gt;, then we are exporting a arrow function &lt;strong&gt;&lt;em&gt;getCurrencySymbol&lt;/em&gt;&lt;/strong&gt; which accepts &lt;strong&gt;&lt;em&gt;currencyCode&lt;/em&gt;&lt;/strong&gt; as an argument. &lt;/p&gt;

&lt;p&gt;Then we are checking for null, empty-string, undefined or string with white space in the &lt;strong&gt;&lt;em&gt;if statement&lt;/em&gt;&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;Now if the currency code entered is correct then we will use a &lt;strong&gt;&lt;em&gt;For loop&lt;/em&gt;&lt;/strong&gt; for checking against the &lt;strong&gt;&lt;em&gt;currencyCode&lt;/em&gt;&lt;/strong&gt; in our &lt;em&gt;&lt;strong&gt;currencyList&lt;/strong&gt;&lt;/em&gt; and returning the corresponding symbol.&lt;/p&gt;

&lt;p&gt;And thats all for the coding part, Give yourself a pat if you have done this much.&lt;/p&gt;

&lt;h2&gt;
  
  
  BONUS 🔥
&lt;/h2&gt;

&lt;p&gt;We are ready for publishing our package but before that we will test it. Yes we will be testing it using jest.&lt;/p&gt;

&lt;p&gt;Go to &lt;em&gt;&lt;strong&gt;test&lt;/strong&gt;&lt;/em&gt; directory and delete all the files, we are pro we will build our own test from scratch. &lt;/p&gt;

&lt;p&gt;Create a &lt;strong&gt;currency.test.ts&lt;/strong&gt; file in the &lt;strong&gt;&lt;em&gt;test&lt;/em&gt;&lt;/strong&gt; directory. And write the code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { getCurrencySymbol } from '../src';

describe('Symbol-Check', () =&amp;gt; {
  it('works', () =&amp;gt; {
    expect(getCurrencySymbol('INR')).toEqual('₹');
  });
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here we are checking if our function is working, and for that we have created a test named &lt;strong&gt;&lt;em&gt;Symbol-Check&lt;/em&gt;&lt;/strong&gt; and we are passing &lt;em&gt;INR&lt;/em&gt; as our currency code and expecting &lt;em&gt;₹&lt;/em&gt; symbol, and if this happens our test will get pass.&lt;/p&gt;

&lt;p&gt;Now run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn test
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And you will see a test pass successful message.&lt;/p&gt;

&lt;h2&gt;
  
  
  Let's publish our package.
&lt;/h2&gt;

&lt;p&gt;But before it we need to change few configuration in our &lt;strong&gt;&lt;em&gt;tsconfig.json&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Change the &lt;em&gt;noImplicitReturns&lt;/em&gt; to &lt;em&gt;false&lt;/em&gt; in the &lt;strong&gt;&lt;em&gt;tsconfig.json&lt;/em&gt;&lt;/strong&gt;. Why we are doing it ? You can check this at - &lt;a href="https://www.typescriptlang.org/tsconfig#noImplicitReturns"&gt;Here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Your &lt;em&gt;&lt;strong&gt;tsconfig.json&lt;/strong&gt;&lt;/em&gt; should look like this-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  // see https://www.typescriptlang.org/tsconfig to better understand tsconfigs
  "include": ["src", "types"],
  "compilerOptions": {
    "module": "esnext",
    "lib": ["dom", "esnext"],
    "importHelpers": true,
    // output .d.ts declaration files for consumers
    "declaration": true,
    // output .js.map sourcemap files for consumers
    "sourceMap": true,
    // match output dir to input dir. e.g. dist/index instead of dist/src/index
    "rootDir": "./src",
    // stricter type-checking for stronger correctness. Recommended by TS
    "strict": true,
    // linter checks for common issues
    "noImplicitReturns": false,
    "noFallthroughCasesInSwitch": true,
    // noUnused* overlap with @typescript-eslint/no-unused-vars, can disable if duplicative
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    // use Node's module resolution algorithm, instead of the legacy TS one
    "moduleResolution": "node",
    // transpile JSX to React.createElement
    "jsx": "react",
    // interop between ESM and CJS modules. Recommended by TS
    "esModuleInterop": true,
    // significant perf increase by skipping checking .d.ts files, particularly those in node_modules. Recommended by TS
    "skipLibCheck": true,
    // error out if import and file system have a casing mismatch. Recommended by TS
    "forceConsistentCasingInFileNames": true,
    // `tsdx build` ignores this option, but it is commonly used when type-checking separately with `tsc`
    "noEmit": true
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now let's publish our package.&lt;/p&gt;

&lt;p&gt;You just need to run one command to publish your package.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;🎉 Hurray You just published your typescript package on npm. 🥳&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Code&lt;/strong&gt; - &lt;a href="https://github.com/Anishpras/currency-symbol-generator"&gt;https://github.com/Anishpras/currency-symbol-generator&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Website&lt;/strong&gt; - &lt;a href="http://www.anishprashun.com"&gt;www.anishprashun.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;LinkedIn&lt;/strong&gt; - &lt;a href="https://www.linkedin.com/in/anishpras118"&gt;https://www.linkedin.com/in/anishpras118&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Twitter&lt;/strong&gt; - &lt;a href="https://twitter.com/APrashun"&gt;https://twitter.com/APrashun&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>typescript</category>
      <category>webdev</category>
      <category>npm</category>
    </item>
  </channel>
</rss>
