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 🙏

© 2025 – Pkg Stats / Ryan Hefner

hisonjs

v1.1.3

Published

hisondev's client-side development support module

Downloads

656

Readme

hisonjs

npm version
hisonjs is a client-side library that serves as a core module for the hisondev solution. It provides utilities, security enhancements, data modeling, and API communication support. This library becomes even more powerful when used with hisonjv, a Java library for Spring-based applications.


Features

  • Dynamic Configuration: Configure global settings through hison methods like setProtocol and setDateFormat.
  • Security Module: Harden your application using hison.shield.execute(), which provides multiple layers of protection.
  • Data Modeling: Create and manipulate structured data using DataModel and DataWrapper.
  • API Communication: Utilize CachingModule and ApiPost for efficient and promise-based API communication.

Installation

Install hisonjs via npm:

npm install hisonjs

Usage Overview

Step 1: Configure hison

Before using any features, configure the hison object to match your application's requirements.

import hison from "hisonjs";

hison.setProtocol("https://");
hison.setDateFormat("yyyy-MM-dd");
hison.setExposeIpList(["192.168.1.1", "10.0.0.2"]);

Step 2: Strengthen Security

Execute the security module to enhance application protection.

hison.shield.execute(hison);

Step 3: Utilize hison Modules

You can use hison.util, hison.data, and hison.link to manage data, validate values, and communicate with your backend.


Examples

1. Utility Functions (hison.util)

Use hison.util to format dates, validate strings, and perform various utility operations.

const formattedDate = hison.util.formatDate(new Date(), "yyyy-MM-dd HH:mm:ss");
console.log("Formatted Date:", formattedDate);

const isAlpha = hison.util.isAlpha("HelloWorld");
console.log("Is Alpha:", isAlpha);

2. Data Modeling (hison.data)

Use hison.data to create structured data models for seamless communication between front-end and back-end.

const dataModel = new hison.data.DataModel();
dataModel.setColumns(["name", "age"]);
dataModel.addRow({ id: 1, name: "Alice" });
console.log(dataModel.getObject());

3. API Communication (hison.link)

Perform API calls with CachingModule and ApiPost.

const cachingModule = new hison.link.CachingModule();
const post = new hison.link.ApiPost("MemberService.getMember", cachingModule);

const dataWrapper = new hison.data.DataWrapper();
dataWrapper.add("memberId", 123);

post.call(dataWrapper).then(result => {
  console.log("API Response:", result.data);
}).catch(error => {
  console.error("API Error:", error);
});

Full Initialization Example

import hison from "hisonjs";

// Step 1: Configure hison
hison.setProtocol("https://");
hison.setDatetimeFormat("yyyy-MM-dd HH:mm:ss");

// Step 2: Execute security module
hison.shield.execute(hison);

// Step 3: Use utility functions, data models, and API communication
const formattedDate = hison.util.formatDate(new Date(), "yyyy-MM-dd");
console.log(formattedDate);

const dataModel = new hison.data.DataModel();
dataModel.setColumns(["id", "name"]);
dataModel.addRow({ id: 1, name: "Alice" });

const apiPost = new hison.link.ApiPost("UserService.getUser");
apiPost.call(new hison.data.DataWrapper("select", dataModel)).then(response => console.log(response.data));

Repository & Issues


License

This project is licensed under the MIT License. See the LICENSE file for details.


Author

Hani Son
GitHub Profile