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

nexious-library

v2.7.23

Published

Official database for nexious.tech

Downloads

1,353

Readme

NEXIOUS LIBRARY

Download

  • npm
    • npm i -S nexious-library
  • Yarn:
    • yarn add nexious-library

Setting up TS its a starter guide

  1. download typescript and associated types as dev dependency

  2. create ts.config.json for ts linting

    • tsconfig.json
        {
          "compilerOptions": {
            "target": "ES2022", // if code runs on the browser Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
            "module": "ES2020",
            "moduleResolution": "Node",
            "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
            "allowSyntheticDefaultImports": true, // e.i import package from 'library'
            "jsx": "react-jsx" /* Specify what JSX code is generated. */,
            "baseUrl": "src" /* Specify the base directory to resolve non-relative module names. */,
            "paths": {
              // "@context/*": ["src/utils/context/*"]
            } // Specify a set of entries that re-map imports to additional lookup locations. */,
            "forceConsistentCasingInFileNames": true,
            "declaration": true /* Generate .d.ts files from TypeScript and JavaScript files in your project. */,
            "sourceMap": true /* Create source map files for emitted JavaScript files. */,
            "outDir": "dist" /* Specify an output folder for all emitted files. */,
            "isolatedModules": true,
            "strict": true /* Enable all strict type-checking options. */,
            "lib": ["ES5", "ES2015", "ES2016", "DOM", "ESNext", "DOM.Iterable"],
            "declarationMap": true /* Create sourcemaps for d.ts files. */,
            "inlineSources": true /* Include source code in the sourcemaps inside the emitted JavaScript. */
          },
          "include": ["src/*"],
          "exclude": ["node_modules"]
        }
    
  3. update index.html script tag to point to new ts file

    • old index.html = <script type="module" src="/src/main.jsx"></script>
    • new index.html = <script type="module" src="/src/main.tsx"></script>
  4. update scripts in package.json file to include a watch file to watch for changes

    • add command "watch": "tsc -p tsconfig.json -w"
  5. if you are adding typescript to an existing application dont rename files manually.

    • run terminal on root cd node_modules/nexious-library && npm run renameFile src 'jsx' 'tsx'
    • this command takes 3 required arguments:
      1. first is the path usually src
      2. second is the file extension of the files you want to rename probably 'jsx'
      3. third is the desired file extension name
    • this will run a shell script. that will:
      • rename all files to desired the extention name in the desired path

Techstack

  1. This app was built using typescript scss and compiles to js and css
  2. Typescript
  3. Javascript
  4. Vite + React

Import CSS

  • find your index file and add import "nexious-library/@index.css"

Usage

Works out of the box with following initial props:

  1. Calendar Usage

    • value is the only as required prop used to tell the component currentdate value
    • Outputs Calendar with month as default view:
        <Calendar
          <!-- required props -->
            value: Date; for initial date use today = new Date();
          <!-- optional props -->
            minDate?: Date; the mininum date the calendar will go back
            onDayClick?: (e: unknown) => void; when day is clicked
            setDay?: (a: unknown) => void; set new current date
            theme?: string;
            events?: [
              <!-- display calendar events on calendar -->
              {
              date: string;
              list: [{
                      date: string;
                      start: number,
                      end: number,
                      isOpen:boolean,
                      uid: string
                }]}];
        />
  2. Form Usage:

    • initialValues and onSubmit as required props
      <Form
        <!-- required props -->
        initialValues: { [key:string]:any };   // e.g. { appName:"", isNewApp:true }
        formId: string;                        // give your form an Id, is only required with Paginate Form
        <!-- optional -->
        heading?: string;                      // title of the form
        previewLabel?: string;                 // add preview label for button to view changes on form
        responseErr?: string;                  // add error message after AJAX request failed
        submitLabel?: string;                  // use your custom submit button label
        theme?: string;                        // overwrite styling with your own
        hideLabels?: boolean;                  // hide form labels
        hideSubmit?: boolean;                  // hide submit button
        withFileUpload?: boolean;              // this is required to upload files
       dataList?: {[key:string]:  {            // name of field affected
           name:"",
          value:"",
           label:""
          } []} // data list for field with input type === select
        labels?:  {[key: string]: string} ;      // use your custom labels for your form field  e.g. { appName:"enter new app name " }
        placeholders?:  {[key: string]: string}; // use your custom placeholders
        types?:  {[key: string]: string};       // use your custom field types
        schema?: {
          required: string[], // field name of required data
           unique?: {
             name: "" // field name affected
             list: string[] // fist of string values that data cannot be
             }
         };       // enter your desired schema for
        fieldHeading?: { [key: string]: string }; // enter custom field heading
        addEntry?: {                           // works with type ="checkbox" and adds new field values when a
          [key: string]: {                      // name of field affected
            additionLabel: string;
            removalLabel: string;
            initialValues: {[key:string]:any};
            fieldHeading: string;
            labels?:  {[key: string]: string} ;
            placeholders?:  {[key: string]: string} ;
            types?:  {[key: string]: string} ;
            canMultiply?: boolean;
          };
        };
        onSubmit?: (e: any) => void;            // create your custom submit function it will work with out it but it will do nothing
        onChange?: (e: any) => void;           // create your custom onChange event handlers
        onCancel?: () => void;           // add custom function for cancelling
        onViewPreview?: (e: any) => void;           // create your custom function to view data
      />
  3. PaginatedForm Usage

    • paginate is array with initialValues and onSubmit as required props
      <PaginateForm
        <!-- required props -->
          paginate: [
            {
                   <!-- required props -->
             initialValues: { [key:string]:any };   // e.g. { appName:"", isNewApp:true }
             formId: string;                        // give your form an Id, is only required with Paginate Form
             <!-- optional -->
             heading?: string;                      // title of the form
             previewLabel?: string;                 // add preview label for button to view changes on form
             responseErr?: string;                  // add error message after AJAX request failed
             submitLabel?: string;                  // use your custom submit button label
             theme?: string;                        // overwrite styling with your own
             hideLabels?: boolean;                  // hide form labels
             hideSubmit?: boolean;                  // hide submit button
             withFileUpload?: boolean;              // this is required to upload files
             dataList?: {[key:string]:  {            // name of field affected
                 name:"",
               value:"",
                 label:""
               } []} // data list for field with input type === select
             labels?:  {[key: string]: string} ;      // use your custom labels for your form field  e.g. { appName:"enter new app name " }
             placeholders?:  {[key: string]: string}; // use your custom placeholders
             types?:  {[key: string]: string};       // use your custom field types
             schema?: {
               required: string[], // field name of required data
                 unique?: {
                   name: "" // field name affected
                   list: string[] // fist of string values that data cannot be
                   }
               };       // enter your desired schema for
             fieldHeading?: { [key: string]: string }; // enter custom field heading
             addEntry?: {                           // works with type ="checkbox" and adds new field values when a
               [key: string]: {                      // name of field affected
                 additionLabel: string;
                 removalLabel: string;
                 initialValues: {[key:string]:any};
                 fieldHeading: string;
                 labels?:  {[key: string]: string} ;
                 placeholders?:  {[key: string]: string} ;
                 types?:  {[key: string]: string} ;
                 canMultiply?: boolean;
               };
             };
             onSubmit?: (e: any) => void;            // create your custom submit function it will work with out it but it will do nothing
             onChange?: (e: any) => void;           // create your custom onChange event handlers
             onCancel?: () => void;           // add custom function for cancelling
             onViewPreview?: (e: any) => void;           // create your custom function to view data
       }   ];
          onFormSumbit={(e:any)=>void }                     // create your custom onFormSubmit function
        <!-- optional props -->
          navigationHeading?: string ;                   // add custom navigation title
             theme?: string;                        // overwrite styling with your own
          page?: number;                                   //  default is 0
          responseErr?: string;                  // add error message after AJAX request failed
          order?: string[]; default is orginal order      // use your custom order to traverse form
          previewPage?: <YourOwnComponent  preview={formData} />;                  // add your own custom component
          hideNavigation?: boolean;                     //  hide paginated navigation
          setNewPage={(e:any)=>void }                     //   create your custom setNewPage function
          onCancel={(e:any)=>void }                     //   cancel form function
          onPageClick={(e:any)=>void }                     //   navigation button pressed
          onDialogClose={(e:any)=>void }                     //   Dialog close button pressed
      />

Visit <www.nexious.tech/docs> for more advanced settings

MORE COMING SOON

With more comming soon