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

fp-ng-components

v2.2.0

Published

This project is the shared components and helpers that are being using for most fast-pack apps

Downloads

9

Readme

fast-pack-app-components

Available modules

  • FpAutoFocusModule
  • FpAlertModule
  • FpLoadingModule
  • FpProductNumberModule
  • FpAuthModule - use forRoot
  • FpEventModule - use forRoot
  • FpLocalStorageModule - use forRoot
  • FpNewRelicModule - use forRoot

The forRoot functions take the following variables:

FpLocalStorageModule.forRoot(prefix: string)

FpAuthModule.forRoot({
  userServiceAPI: string,
  parentURL: string,
  serviceName: string
})

FpEventModule.forRoot({
  eventServiceAPI: string,
  warehouseCode: string
})

FpNewRelicModule.forRoot({
  serviceName: string,
  appVersion: string
})

Inter Module Dependencies

The following modules use the modules in the 'Includes' column optionally. | Module | Includes | |--|--| |FpAuthModule| FpNewRelicModule, FpLoadingModule, FpAlertModule | |FpLoadingModeule | FpAlertModule |

Available Services

  • FpAlertService
  • FpAuthService
  • FpEventService
  • FpLoadingService
  • FpLocalStorageService
  • FpNewRelicService

Others

  • FpAuthGuard
  • fpAutoFocus
  • fpProductNumber
  • FpUserModel
  • FpRoleModel

Notes

To use the FpAlertService you have to add "../node_modules/ngx-toastr/toastr.css" to the styles section of angular-cli.json

FpAlertService

|Function| Input |Explination| |-|-|-| |success| message: string, options?: IndividualConfig| Display success message. | |error| message: string, options?: IndividualConfig| Display error message. | |info| message: string, options?: IndividualConfig| Display info message. | |warn| message: string, options?: IndividualConfig| Display warning message. | |handleError | error: HttpErrorResponse | TimeoutError | any | This is for handling most common errors that would get thrown from angular HttpErrors, and thrown errors.| | clear| N/A | Clears all notifications from page.| |IndividualConfig| Interface|See https://github.com/scttcper/ngx-toastr/blob/master/src/lib/toastr/toastr-config.ts for documentation. |

FpAuthGuard

Only implements the canActivate function. In order to use the FpAuthGuard data.allowedRoles must exist in the Router module.

FpAuthService

|Function| Input |Explination| |-|-|-| |isAuthenticated| N/A| Calls the user service to check the bearer token saved inside the cookie. | |hasRequiredRole| requiredRoles: string | string[]| Checks the user for the roles passed in. | This has a user. That user is UserModel, and is the currently logged in user. If you need to get anything about the currently logged in user use this attribuite. The authInterceptor that will be added automatically and add the bearer token to all API calls.

fpAutoFocus

Make any input auto focus by adding the fpAutoFocus attribute to the input tag.

To not let people click outside of the input field do the following: <input [fpAutoFocus]="true">

FpEventService

|Function| Input |Explination| |-|-|-| |createEvent| name: string, eventData?: any | This will send any data to the event service. |

FpLoadingService

|Function| Input |Explination| |-|-|-| |startLoading | timeoutDuration: number = 30 * 1000| Overlay the loading screen. timeoutDuration is in seconds. | |stopLoading | N/A | Remove the overlay. | |isLoading | N/A | Test whether the overlay is set. | |loadingHeartbeat | timeoutDuration: number = 10 * 1000| Keep the overlay running and place new timer. timeoutDuration is in seconds. |

FpLocalStorageService

|Function| Input |Explination| |-|-|-| |get | key: string, defaultItem: any = null) | Returns a JSON object from the localStorage. Default is what is returned when there is nothing in localStorage. | |set | key: string, value: any | Set localStorage value. | |remove | key: string | Remove the key from localStorage. | |clear | | Remove everything from localStorage set by this service. |

FpNewRelicService

|Function| Input |Explination| |-|-|-| | setUserUuid |uuid: string| Set the user uuid before doing anything. This makes sure that New Relic will have the user for every error reported. |

  • By including the FpNewRelicModule it will overwrite the standard Angular error handler with the new Relic error handler. Errors will be sent to New Relic.

FpVersionCheckerService

|Function| Input |Explination| |-|-|-| | checkAppVersion |config: object| Start listening for version change by checking package.json file by polling the file remotely. |

fpProductNumber

Name of the pipe fpProductNumber

This pipe will take a upc and turn it into a more recognizable string by removing the check digit and showing only the last few characters. It aslo will handle a bad UPC or no UPC.

FpUserModel

|Attribute| Type |Explanation| |-|-|-| |uuid| string| The users database id. | |roles| FpRoleModel[]| The roles owned by the user. | |email| string| Users email. | |firstName| string|Users first name. | |lastName| string|Users last name. | |username| string|Users username. | |barcodeLogin| boolean| Whether the user is allowed to log into the system with a barcode or not. | |password| string| Users Password. | |createdAt| Date|Date role was created. | |updatedAt| Date|Last update time. | |hasRole|(roleSlug: string)=>{boolean}| Pass in the role you want to check the user for. It will return true if the user has the role. |

FpRoleModel

|Attribute| Type |Explanation| |-|-|-| |slug| string| The name of the role.| |roleName| string| The human readable role name.| |createdAt| Date| Date role was created.| |updatedAt| Date| Last update time.| |updatedBy| string| Who updated the role last.|