<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Npm on Micha Kops&#39; Tech Notes</title>
    <link>https://www.hascode.com/tags/npm/</link>
    <description>Recent content in Npm on Micha Kops&#39; Tech Notes</description>
    <generator>Hugo</generator>
    <language>en</language>
    <copyright>Copyright © 2010 - 2025 Micha Kops. #e9d956c0c0154a221ad83c925346a8fa0e72f866</copyright>
    <lastBuildDate>Fri, 28 Mar 2025 00:00:00 +0100</lastBuildDate>
    <atom:link href="https://www.hascode.com/tags/npm/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>CVE Scanning and Guided Remediation with OSV Scanner</title>
      <link>https://www.hascode.com/cve-scanning-and-guided-remediation-with-osv-scanner/</link>
      <pubDate>Fri, 28 Mar 2025 00:00:00 +0100</pubDate>
      <guid>https://www.hascode.com/cve-scanning-and-guided-remediation-with-osv-scanner/</guid>
      <description>&lt;div id=&#34;preamble&#34;&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;imageblock&#34;&gt;
&lt;div class=&#34;content&#34;&gt;
&lt;img src=&#34;osv-scanner-cover.webp&#34; alt=&#34;osv scanner cover&#34;/&gt;
&lt;/div&gt;
&lt;div class=&#34;title&#34;&gt;Figure 1. OSV Scanner&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;Security is a critical aspect of software development, and staying ahead of vulnerabilities is essential for us application developers. Google’s OSV Scanner is a powerful tool that helps detect vulnerabilities in open-source dependencies.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;This article will guide us through setting up and using OSV Scanner to secure our projects, scan for invalid licenses, scan OCI images and finally how to fix findings via guided remediation.&lt;/p&gt;
&lt;/div&gt;</description>
    </item>
    <item>
      <title>Prettier Code Formatter Configuration</title>
      <link>https://www.hascode.com/prettier-code-formatter-configuration/</link>
      <pubDate>Fri, 14 May 2021 00:00:00 +0200</pubDate>
      <guid>https://www.hascode.com/prettier-code-formatter-configuration/</guid>
      <description>&lt;div id=&#34;preamble&#34;&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;sidebarblock&#34;&gt;
&lt;div class=&#34;content&#34;&gt;
&lt;div class=&#34;title&#34;&gt;Goals&lt;/div&gt;
&lt;div class=&#34;olist arabic&#34;&gt;
&lt;ol class=&#34;arabic&#34;&gt;
&lt;li&gt;
&lt;p&gt;Setup Prettier for different environments / IDEs&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Run Prettier via git hooks&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
&lt;h2 id=&#34;_install_prettier&#34;&gt;Install Prettier&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;Install via npm&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;listingblock&#34;&gt;
&lt;div class=&#34;content&#34;&gt;
&lt;pre class=&#34;highlight&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;npm install --save-dev --save-exact prettier&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;Add empty configuration file&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;listingblock&#34;&gt;
&lt;div class=&#34;content&#34;&gt;
&lt;pre class=&#34;highlight&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;echo {}&amp;gt; .prettierrc.json&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;Create Prettier ignore file &lt;code&gt;.prettierignore&lt;/code&gt;:&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;listingblock&#34;&gt;
&lt;div class=&#34;content&#34;&gt;
&lt;pre class=&#34;highlight&#34;&gt;&lt;code&gt;# Ignore artifacts:
build
coverage&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;Format all project files with Prettier:&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;listingblock&#34;&gt;
&lt;div class=&#34;content&#34;&gt;
&lt;pre class=&#34;highlight&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;npx prettier --write .&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
&lt;h2 id=&#34;_git_hooks&#34;&gt;Git Hooks&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;Adding the following lines to the project’s &lt;code&gt;package-json&lt;/code&gt; makes ESLint and Prettier run before each commit:&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;listingblock&#34;&gt;
&lt;div class=&#34;content&#34;&gt;
&lt;pre class=&#34;highlight&#34;&gt;&lt;code class=&#34;language-json&#34; data-lang=&#34;json&#34;&gt;{
  &amp;#34;husky&amp;#34;: {
    &amp;#34;hooks&amp;#34;: {
      &amp;#34;pre-commit&amp;#34;: &amp;#34;lint-staged&amp;#34;
    }
  },
  &amp;#34;lint-staged&amp;#34;: {
    &amp;#34;**/*&amp;#34;: &amp;#34;prettier --write --ignore-unknown&amp;#34;
  }
}&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;</description>
    </item>
    <item>
      <title>Quick Mobile Application Prototyping with Ionic Creator</title>
      <link>https://www.hascode.com/quick-mobile-application-prototyping-with-ionic-creator/</link>
      <pubDate>Tue, 17 Nov 2015 00:00:00 +0100</pubDate>
      <guid>https://www.hascode.com/quick-mobile-application-prototyping-with-ionic-creator/</guid>
      <description>&lt;div id=&#34;preamble&#34;&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;When it comes to the field of hybrid mobile application development, Ionic and its tool-stack is often an attractive choice.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;Now there is Ionic Creator to speed up the development process offering an in-browser editor to create user interfaces via drag and drop and supporting basic templates for mobile applications like tabbed layouts etc.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;In addition, a project created with this tool may be downloaded and started with easy and that’s what I’d like to show in the following short example.&lt;/p&gt;
&lt;/div&gt;</description>
    </item>
    <item>
      <title>Creating and Providing HipChat Integrations with Atlassian Connect, Nodejs and Express</title>
      <link>https://www.hascode.com/creating-and-providing-hipchat-integrations-with-atlassian-connect-nodejs-and-express/</link>
      <pubDate>Tue, 18 Aug 2015 00:00:00 +0200</pubDate>
      <guid>https://www.hascode.com/creating-and-providing-hipchat-integrations-with-atlassian-connect-nodejs-and-express/</guid>
      <description>&lt;div id=&#34;preamble&#34;&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;HipChat is Atlassian’s alternative to Slack and its solution to team collaboration chats. Atlassian Connect offers developer tools to bootstrap applications, connect to Atlassian’s cloud products with easy and in combination with HipChat’s REST APIs allows us to write integrations for such a chat server in no time.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;In the following tutorial I’d like to show how to write an integration within a few steps using Atlassian Connect, Node.js and Express and how to connect the integration to a HipChat server.&lt;/p&gt;
&lt;/div&gt;</description>
    </item>
    <item>
      <title>Creating a hybrid mobile Application with Ionic, Cordova and AngularJS</title>
      <link>https://www.hascode.com/creating-a-hybrid-mobile-application-with-ionic-cordova-and-angularjs/</link>
      <pubDate>Sun, 03 May 2015 00:00:00 +0200</pubDate>
      <guid>https://www.hascode.com/creating-a-hybrid-mobile-application-with-ionic-cordova-and-angularjs/</guid>
      <description>&lt;div id=&#34;preamble&#34;&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;Nowadays in the realm of hybrid mobile application development there is a variety of available frameworks worth having a look at.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;In the following tutorial I’d like to demonstrate the development life-cycle for a complete mobile application using Ionic, Cordova and AngularJS (and others) covering every step from the initial project setup, creating Angular Controllers, Directives, adding Cordova Plug-Ins, running and testing the application in the browser and emulator up to finally running the application on an Android device and assembling files for a release.&lt;/p&gt;
&lt;/div&gt;</description>
    </item>
    <item>
      <title>JavaScript Snippets</title>
      <link>https://www.hascode.com/javascript-snippets/</link>
      <pubDate>Mon, 01 Mar 2010 00:00:00 +0100</pubDate>
      <guid>https://www.hascode.com/javascript-snippets/</guid>
      <description>&lt;div class=&#34;sect1&#34;&gt;
&lt;h2 id=&#34;_creating_a_nodejs_module&#34;&gt;Creating a Nodejs Module&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;sect2&#34;&gt;
&lt;h3 id=&#34;_1_create_a_package_json_using_npm_init&#34;&gt;1) Create a package.json using npm init&lt;/h3&gt;
&lt;div class=&#34;listingblock&#34;&gt;
&lt;div class=&#34;content&#34;&gt;
&lt;pre class=&#34;highlight&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;$ npm init&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;This utility will walk you through creating a &lt;code&gt;package.json&lt;/code&gt; file.
It only covers the most common items, and tries to guess sane defaults.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;See &lt;code&gt;npm help json&lt;/code&gt; for definitive documentation on these fields
and exactly what they do.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;Use &lt;code&gt;npm install &amp;lt;pkg&amp;gt; --save&lt;/code&gt; afterwards to install a package and
save it as a dependency in the package.json file.&lt;/p&gt;
&lt;/div&gt;</description>
    </item>
  </channel>
</rss>
