Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@ridi/comic-parser
Advanced tools
Common comic data parser for Ridibooks services
npm install @ridi/comic-parser
Basic:
import { ComicParser } from '@ridi/comic-parser';
// or const { ComicParser } = require('@ridi/comic-parser');
const parser = new ComicParser('./foo/bar.zip' or './unzippedPath');
parser.parse(/* { parseOptions } */).then((items) => {
parser.readItems(items/*, { readOptions } */).then((results) => {
...
});
...
});
with Cryptor:
import { CryptoProvider, Cryptor } from '@ridi/comic-parser';
// or const { CryptoProvider, Cryptor } = require('@ridi/comic-parser');
const { Purpose } = CryptoProvider;
const { Modes, Padding } = Cryptor;
class ContentCryptoProvider extends CryptoProvider {
constructor(key) {
super();
this.cryptor = new Cryptor(Modes.ECB, { key });
}
getCryptor(filePath, purpose) {
return this.cryptor;
}
// If use as follows:
// const provider = new ContentCryptoProvider(...);
// const parser = new ComicParser('encrypted.zip', provider);
// const book = await parser.parse({ unzipPath: ... });
// const firstImage = await parser.readItem(book.items[0]);
//
// It will be called as follows:
// 1. run(data, 'encrypted.zip', Purpose.READ_IN_DIR)
// 2. run(data, '0001.jpg', Purpose.READ_IN_ZIP)
// ...
// 4. run(data, '0001.jpg', Purpose.WRITE)
// ...
// 5. run(data, '0001.jpg', Purpose.READ_IN_DIR)
//
run(data, filePath, purpose) {
const cryptor = this.getCryptor(filePath, purpose);
const padding = Padding.AUTO;
if (purpose === Purpose.READ_IN_DIR) {
return cryptor.decrypt(data, padding);
} else if (purpose === Purpose.WRITE) {
return cryptor.encrypt(data, padding);
}
return data;
}
}
const cryptoProvider = new ContentCryptoProvider(key);
const parser = new ComicParser('./encrypted.zip' or './unzippedPath', cryptoProvider);
Returns Promise<Book>
with:
Or throw exception.
?object
Returns string
or Buffer
in Promise
with:
If readOptions.base64
is true
:
string
Other:
Buffer
or throw exception.
?object
Returns string[]
or Buffer[]
in Promise
with:
If readOptions.base64
is true
:
string
Other:
Buffer
or throw exception.
?object
?string
If specified, uncompress to that path.
only using if input is Zip file.
Default: undefined
boolean
If true, overwrite to unzipPath when uncompress.
only using if unzipPath specified.
Default: true
string[]
File extension to allow when extracting lists.
Default: ['jpg', 'jpeg', 'png', 'bmp', 'gif']
boolean
If false, reads image into a buffer.
Default: false
FAQs
Common comic data parser for Ridibooks services
The npm package @ridi/comic-parser receives a total of 3 weekly downloads. As such, @ridi/comic-parser popularity was classified as not popular.
We found that @ridi/comic-parser demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 9 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.