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

node-wick

v5.1.0

Published

NodeJS Bindings for the JohnWickParse library

Downloads

63

Readme

node-wick

NodeJS Bindings for the JohnWickParse library

Extracting

The Extractor class is used to extract files from a .utoc/ucas.

The AES key is ignored in the case of non-encrypted .utoc/ucas files, so an empty string is acceptable in these cases, although null or undefined may produce an error.

Requirements

Extracting from utoc/ucas archives requires that oo2core_8_win64.dll is in the working directory on Windows, and oo2core_8_win64.so is present on Linux.

Linoodle is an acceptable substitute for oo2core_8_win64.so on Linux systems.

const fs = require('fs');
const { Extractor } = require('node-wick');

// Make a new Extractor by specifying the file path (minus the extension), and the AES encryption key as a hexadecimal string.
let extractor = new Extractor("pakchunk", "");

// Iterate over all the files in the ucas, and extract them.
// get_file_list returns an array of file paths within the ucas. You will need the index in the array to extract the files.
extractor.get_file_list().forEach((v, idx) => {
    // get_file(path) returns a NodeJS Buffer with the decrypted file contents.
    fs.writeFileSync(idx + ".uasset", extractor.get_file(v));
});

Parsing

New Asset Format Requirements

As of Fortnite 14.40, asset files now use a format known as 'Unversioned Properties'. This format is no longer self-describing, and parsing them is significantly more complex. This library attempts to simplify this using 'mapping' files, which contain the description of each class that is necessary to parse that class of asset file.

The official mapping files for node-wick are hosted on the JohnWickParse repository. However, these are incomplete, and are at best, the bare minimum required to parse the item descriptions for the Fortnite shop.

Lucas7yoshi also maintains a repository of asset class mappings, which you can find on his GitHub repository.

FunGames and Officer also maintain a repository of mapping files, however these are in a different format to that used by node-wick, but a converter can be used to translate these mappings.

The mapping files must be present in the mappings inside the working directory. Any parsing will fail if they are not present. There are two types of mapping file, contained in the mappings/classes directory and the mappings/enums directory.

Parsing assets also requires that the global.utoc and global.ucas files are present in the paks/ directory, again in the working directory. You can use wick-downloader to download these files if necessary. The global files must match the version of Fortnite that the assets were obtained from.

Parsing Files

The Package class lets you parse files uasset files. It has two constructors:

const { Package } = require('node-wick');

// Construct a package from a filepath
let asset = new Package("./assets/test");

// Construct a package from several buffers
// Note that the ubulk buffer is optional, but the parser will error if you try to parse an asset that requires it.
let uassset_buf = fs.readFileSync("./assets/test.uasset");
let ubulk_buf = fs.readFileSync("./assets/test.ubulk");
let asset = new Package(uasset_buf, ubulk_buf);

You can get a JSON object of the internal parameters of the objects, using the get_data method:

let asset = new Package("./assets/test");
console.log(JSON.stringify(asset.get_data()));

You can also get a buffer of the Texture contained within the asset (if there is one) using the get_texture method:

let asset = new Package("./assets/test");
fs.writeFileSync("./assets/test.png", asset.get_texture());

Note that retrieving the texture from a Package asset, will invalidate the package (it can no longer be used.)

Pak Key GUID

The read_pak_key(path: string) will return the EncryptionKeyGuid part of the header inside the pak file. You do not need the key to get this data.