npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@omnidyon/ngx-snippets

v1.0.17

Published

An Angular library for adding code snippets top you application. It's easy to use, flexible and lightweight.

Readme


npm install @omnidyon/ngx-snippets

import { OmniSnippetsComponent } from '@omnidyon/ngx-snippets';

You can use the snippets in two ways.

Ether by passing it a snippet config array (see: Snippet Config):

<omni-snippets [snippets]="exampleSnippets"></omni-snippets>

Or by providing the snippet in a template:

  <omni-snippets >
    <ng-template>
      {{`import { SomeClass } from 'some-file';\nexport class SomeOtherClass {\n\tproperty = 0\n\n\tdoSomething() {\n\t\treturn "did it";\n\t}\n}`}}
    </ng-template>
  </omni-snippets>

[!NOTE]
When providing a snippet in a template make sure that proper new liner(\n), tab(\t) indentation are provided as ngx snippets does not format the code, instead it provides code token recognition and styling. so code formatting is on the developer to handle.


SnippetConfig is an interface defining snippets configuration

interface SnippetConfig {
  template: string;
  format: "JavaScript" | "TypeScript" | "HTML" | "CSS";
}

It is also available straight from the library (preferred):

import { SnippetConfig } from '@omnidyon/ngx-snippets';

Config Example:

{
    template: `
/**
 *  Comment example
 */

import { Component } from '@angular/core';

@Component({
    selector: 'app-root',
    imports: [],
    template: \`
        <h1>Hello world!</h1>
    \`,
    styleUrls: ['./app.component.css'],
})

// Comment example
export class AppComponent {
    title = 'homes';
}
`,
    format: 'TypeScript',
}

But you we can custom style them simply by defining desired values.

Here is a list of values we can change to custom style and there meanings

| Variable Name | Meaning | Default value | | --------------------------------- | --------------------------------- | ------------- | | --snippet-font-size | font size of the code | 13px | | --snippets-header-font-size | header tab font size | 12px | | --snippet-letter-spacing | code letter spacing | 1px | | --snippet-border-radius | snippet corner radius | 5px | | --snippet-tab-border-radius | lower corner radius for tabs | 2px | | --snippets-gutter-width | number lines width | 72px | | --snippets-scrollbar-width | scroll bar vertical width | 5px | | --snippets-scrollbar-height | scroll bar horizontal width | 5px | | --snippet-background-color | main background color | #202836 | | --snippet-header-background-color | header background color | #1a212b | | --snippet-header-text-color | header text color | #61789e | | --number-line-highlight-color | color of the number when selected | #38e9ae | | --number-line-hover-color | color of the number when hovered | #07cc8a | | --ka-token-color | Keyword group A color | #e1955d | | --kb-token-color | Keyword group B color | #ff8c5f | | --kc-token-color | Keyword group C color | #22e2b8 | | --quoted-token-color | quotes and quoted text color | #34ec71 | | --data-token-color | color of data type tokens | #a98adf | | --function-token-color | color of function names | #44b7ff | | --separator-token-color | color of , : ; | #676e70 | | --property-token-color | property name token color | #ff8c5f | | --operator-token-color | color of operator tokens | #f8c49e | | --parameter-token-color | color of parameter tokens | #f371a6 | | --var-token-color | color of variable tokens | #cfddd2 | | --comment-token-color | color of comments | gray | | --text-token-color | color of remaining tokens | lightgray | | --element-token-color | html element name color | salmon | | --attribute-color | html attribute color | #ffd255 | | --special-char-token-color | special charter color | #4cdaab | | --check-icon-color | color of check icon | #38e9ae | | --copy-icon-path | svg path for the copy icon | -- | | --check-icon-path | svg path for the check icon | -- | | --snippet-font | fonts | Ubuntu |


import { Backlights, OmniSnippetsComponent, SnippetConfig } from '@omnidyon/ngx-snippets';

Example

  <omni-snippets
    [snippets]="exampleSnippets"
    backlight="backlight-RGB"
  ></omni-snippets>

List of effect:

| Effect Input Name | Effecting Result | | -------------------- | ---------------------------------------------------------------------- | | backlight | Applies Backlight to the snippet | | neon | Applies neon glow to the gutter separator line and lower header border |