New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

ck-node24-wrapper

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ck-node24-wrapper

A wrapper NPM module to abstract os-specific dependencies on @chilkat/ck-node24-* modules

latest
Source
npmnpm
Version
1.0.3
Version published
Weekly downloads
1
-80%
Maintainers
1
Weekly downloads
 
Created
Source

A Wrapper NPM module to abstract os-specific dependencies on the NodeJS Chilkat libraries (@chilkat/ck-node24*).

Contributors Forks Stargazers Issues MIT

ck-node24-wrapper

This is a wrapper NPM module to abstract os-specific dependencies on the NodeJS Chilkat libraries (@chilkat/ck-node24-*).

NOTE: Chilkat libraries are not open source. Some are free to use, while others require a paid license. See the Chilkat website for details.

Freeware classes include: Cert, CertChain, CertStore, Csv, Pfx, PrivateKey, PublicKey, Spider, TrustedRoots, Upload, Xml, JsonObject, ...
Commercial classes include: Ssh, SFtp, Imap, Ftp2, Socket, Rest, OAuth2, Http, ...


Explore the docs »

Report Bug · Request Feature

Table of Contents

About The Project

This is a node module to provide an os-independent wrapper for the os-specific @chilkat/ck-node24-* modules.

So you can have this:

  • With Wrapper:

    import chilkat from "ck-node24-wrapper";
    

Instead of this:

  • Without Wrapper:

    const os = require('os');
    let chilkat;
    if (os.platform() == 'win32') {  
        if (os.arch() == 'ia32') {
            chilkat = require('@chilkat/ck-node11-win-ia32');
        } else {
            chilkat = require('@chilkat/ck-node11-win64'); 
        }
    } else if (os.platform() == 'linux') {
        if (os.arch() == 'arm') {
            chilkat = require('@chilkat/ck-node11-arm');
        } else if (os.arch() == 'x86') {
            chilkat = require('@chilkat/ck-node11-linux32');
        } else {
            chilkat = require('@chilkat/ck-node11-linux64');
        }
    } else if (os.platform() == 'darwin') {
        chilkat = require('@chilkat/ck-node11-macosx');
    }
    

It requires nodejs 24 or later.

NOTE : This is an ESM-only module.

(back to top)

Built With

  • Typescript
  • Mocha
  • NodeJS
  • NPM
  • GitHub
  • VSCode
  • Shields.io

(back to top)

Getting Started

Install this module into your project directory:

npm install ck-node24-wrapper --save

Add ck-install as a "prepare" script in your package.json:

"scripts": {
  "prepare": "ck-install"
}

Then import the module in your code:

import chilkat from "ck-node24-wrapper";

and use the chilkat object as you would normally; e.g.:

import chilkat from "ck-node24-wrapper";

const cert = new chilkat.Cert();
// Load any type of certificate (.cer, .p7b, .pem, etc.) by calling LoadFromFile.
const success = cert.LoadFromFile("qa_data/certs/sample_cert_a.cer");
if (success) {
  console.log("SubjectDN:" + cert.SubjectDN);

  console.log("Common Name:" + cert.SubjectCN);
  console.log("Issuer Common Name:" + cert.IssuerCN);

  console.log("Serial Number:" + cert.SerialNumber);

  console.log(cert.ExportCertPem());
} else {
  console.error("failed to load cert");
}

(back to top)

Issues When Updating Other Packages

When you use NPM (and probably yarn, pnpm etc) to add or update your dependencies, the package manager unfortunately will automatically remove your os-dependent installation of the chilkat library.

If that has happened, then when you run your program you'll see an error like this:

Error: Cannot find module '@chilkat/ck-node24-mac-universal'

This happens because this wrapper installs the appropriate library using the --no-save flag, which means that the package manager (NPM) will not add the library to your package.json file. Then, when the package manager performs another update, it notices the installed library that isn't in the package.json file, and removes it.

This wrapper avoids updating your package.json file, and does not make the assumption that your deployment OS environment is the same as your development OS environment (or even that you are using NPM to manage your other packages).

For example, you might be:

  • Authoring a NodeJS package that uses this wrapper. In that case, you want the consumers of your package to download the appropriate chilkat library for their environment. So you don't want the os-specific chilkat library in the dependencies section of your package.json.
  • Bundling a server application using webpack, parcel, tar, zip or some other packaging tool. The target environment might be different from your development environment, so we want the chilkat installer to run (via npm ci) in the target environment. For example, if your development machine is MacOS and your target machine is Linux, we don't want to include the @chilkat/ck-node24-mac-universal library and omit the appropriate linux one.

Solutions

Solution 1: Manually use the prepare script

If you've added a "prepare" script as per the Getting Started section, then you can rerun the ck-install script manually:

npm run prepare
Solution 2: Use the --save-optional flag

You can explicitly add the os-specific dependency for use on your own machine via the --save-optional flag:

npm install @chilkat/ck-node24-mac-universal --save-optional

That will add it to the optionalDependencies section of your package.json file, which will prevent the package manager from removing it. This will allow NPM to proceed if installation fails. You should note, however, that consumers of your package will be attempting to install that os-specific chilkat library without necessarily using it.

See the optionalDependencies section of the NPM website for more information.

(back to top)

Roadmap

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  • Fork the Project
  • Create your Feature Branch (git checkout -b feature/AmazingFeature)
  • Commit your Changes (git commit -m 'Add some AmazingFeature')
  • Push to the Branch (git push origin feature/AmazingFeature)
  • Open a Pull Request

(back to top)

Top contributors:

contrib.rocks image

License

Distributed under the MIT. See LICENSE.txt for more information.

(back to top)

Contact

Project Link: https://github.com/cunneen/ck-node24-wrapper

(back to top)

Acknowledgments

(back to top)

FAQs

Package last updated on 21 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts