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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@skpm/nib-loader

v0.1.2

Published

nib loader module for webpack

Downloads

1,130

Readme

Nib Loader

Instructs WebPack to compile and emit the required XIB or NIB as file and to return an function to interact with it.

Install

⚠️ The loader is already included in skpm by default so if you come from skpm, you do not have to do anything.

npm install --save-dev @skpm/nib-loader

Add the following rule to your WebPack config:

{
  test: /\.(xib|nib)$/,
  use: [
    {
      loader: '@skpm/nib-loader',
      options: {}
    }
  ]
}

Usage

  • Create a new xib file:

    • open XCode and create a new "Cocoa Framework" project located in your skpm project with the "Objective-C" language.
    • create a new file with the "View" template
    • Use the Interface Builder to design your view
  • Add the following in your plugin command:

    const NibUI = require('../xcode-project-name/view-name.xib')
    
    var nib = NibUI()
    
    let dialog = NSAlert.alloc().init()
    dialog.setAccessoryView(nib.getRoot())
    dialog.runModal()

    The NibUI function returns an object with 2 methods:

    • getRoot which returns the root view
    • getOwner which returns the File Owner Class instance

    The object will also be populated with the Views that have an Identifier set. For example, let's say your nib contains a view with the identifier button. Then you can access this view using nib.button.

Handling events from the xib

You might need to handle some events happening in your view (for example when the user clicks on a button).

TBD (to be documented)

Options

Same as file-loader.