Socket
Socket
Sign inDemoInstall

cemu-smm

Package Overview
Dependencies
Maintainers
1
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cemu-smm - npm Package Compare versions

Comparing version 1.5.5 to 2.0.0

compile.js

20

package.json
{
"name": "cemu-smm",
"version": "1.5.5",
"version": "2.0.0",
"description": "This is a module to simplify all kinds of tasks with Loadiine Super Mario Maker save files and respectively Cemu",
"main": "index.js",
"main": "lib",
"scripts": {
"test": "node test/test"
"compile": "node compile",
"transpile": "babel src --out-dir lib",
"prepare": "npm run compile&& npm run transpile",
"test": "npm run transpile&& node test/test"
},

@@ -17,3 +20,5 @@ "author": "Mario Reder",

"jimp": "^0.2.27",
"rimraf": "^2.6.1"
"protobufjs": "^6.7.3",
"rimraf": "^2.6.1",
"smm-protobuf": "git+https://github.com/Tarnadas/smm-protobuf.git"
},

@@ -25,6 +30,11 @@ "repository": {

"devDependencies": {
"babel-cli": "^6.24.1",
"babel-core": "^6.24.1",
"babel-plugin-transform-async-to-generator": "^6.24.1",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-env": "^1.4.0"
"babel-preset-env": "^1.4.0",
"babel-preset-es2015": "^6.24.1",
"jsdoc-babel": "^0.3.0",
"jsdoc-to-markdown": "^3.0.0"
}
}

@@ -14,7 +14,11 @@ # cemu-smm

## API
Please refer to the full [API Documentation](documentation/api.md)
## Code Example
```js
let smm = require("cemu-smm");
let fs = require("fs");
const smm = require("cemu-smm");
const fs = require("fs");

@@ -31,3 +35,3 @@ (async () => {

// internally done by reorder(), so unnecessary right here
save.writeCrc();
await save.writeCrc();

@@ -46,3 +50,2 @@ // import all jpg files and create tnl files in their respective course folder

//save.loadCourseElements(); // load whole save folder
courses["course001"].loadElements(); // or load single course
fs.writeFileSync(`${__dirname}/course001.json`, JSON.stringify(courses["course001"].getElements(), null, 2));

@@ -73,80 +76,20 @@

## API
## Tutorials
### Reorder
[Installation](tutorial/installation.md)
Load your save
```js
let save = await smm.loadSave("path/to/your/cemu/save/mlc01/emulatorSave/updateID");
```
[Basic Usage](tutorial/basic_usage.md)
When calling
```js
save.reorder();
```
[Save Manipulation](tutorial/save_manipulation.md)
![Alt text](https://raw.githubusercontent.com/Tarnadas/cemu-smm/master/test/reorder_before.jpg)
[Course Manipulation](tutorial/course_manipulation.md)
becomes
[Thumbnail Manipulation](tutorial/thumbnail_manipulation.md)
![Alt text](https://raw.githubusercontent.com/Tarnadas/cemu-smm/master/test/reorder_after.jpg)
[Serialization](tutorial/serialization.md)
### TNL to JPEG
## Documentation
Load an image with
```js
let tnl = smm.loadImage("path/to/your/tnl/file");
```
Do the conversion with
```js
let jpeg = await tnl.toJpeg();
```
Save your file
```js
fs.writeFileSync("path/to/newly/created/jpeg", jpeg);
```
[Course File Structure](documentation/course_file.md)
### JPEG to TNL
Load an image with
```js
let jpeg = smm.loadImage("path/to/your/jpeg/file");
```
Do the conversion with
```js
let tnl = await jpeg.fromJpeg([isWide, [doCrop = false]]);
```
If ```isWide === true```, thumbnail0 will be created, otherwise thumbnail1.
If ```isWide === null```, the algorithm tries to guess the correct aspect ratio.
If ```doCrop === false```, parts of the image may be letter boxed.
If ```doCrop === false```, parts of the image may be cropped.
Images will automatically be resized to fit Super Mario Maker standards. You can even convert 4k images. If the file is still too big after rescaling, the quality of the JPEG will be shrinked.
Save your file
```js
fs.writeFileSync("path/to/newly/created/jpeg", tnl);
```
### JPEG mass export
To convert all tnl files inside your save to jpeg, call
```js
save.exportJpeg();
```
Navigate to your save folder and find jpeg files inside course folders.
### JPEG mass import
To convert all jpeg files inside your save to tnl, call
```js
save.importJpeg();
```
Files inside course folders must be named ```thumbnail0.jpg``` or ```thumbnail1.jpg````.
Refer to [this](https://github.com/Tarnadas/cemu-smm/blob/master//tutorial/import_thumbnail.md) tutorial.
## License

@@ -153,0 +96,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc