1.1.3 • Published 3 years ago

uncompress-react-native v1.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Uncompress React Native

CI codecov License: MIT contributions welcome

Simple library to decompress files .zip, .rar, .cbz and .cbr in React Native.

Installation

yarn add uncompress-react-native

or

npm install uncompress-react-native

iOS Pods installation

After installing the library, you can install pods using the command: cd ios && pod install && cd ..

• If you will have problems with the installation of the dependency UnrarKit, you need add in your Podfile use_frameworks!

• If you will have problems with [CP-User] Generate Specs after add use_frameworks!, you can modify your post_install to fix.

The solution discussion reference

post_install do |installer|
  react_native_post_install(installer)

  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
    end

    if (target.name&.eql?('FBReactNativeSpec'))
      target.build_phases.each do |build_phase|
        if (build_phase.respond_to?(:name) && build_phase.name.eql?('[CP-User] Generate Specs'))
          target.build_phases.move(build_phase, 0)
        end
      end
    end
  end
end

npm.io

Usage

import Uncompress from 'uncompress-react-native';

// ...
await Uncompress.extract({
  filePath: 'temp/sample_comic.cbr',
  destination: 'data/comic',
});
// ...

Extract protected file

// ...
await Uncompress.extract({
  filePath: 'temp/sample_protected_comic.cbr',
  destination: 'data/comic',
  password: '123',
});
// ...

Override files after extraction if successful

// ...
await Uncompress.extract({
  filePath: 'temp/sample_protected_comic.cbr',
  destination: 'data/comic',
  override: true,
});
// ...

Checks whether the file is password protected

// ...
const isProtected = await Uncompress.isProtected({
  filePath: 'temp/sample_protected_comic.cbr',
});

console.log(isProtected);
// ...

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

Credits

  1. UnrarKit
  2. SSZipArchive
  3. slf4j
  4. junrar

License

MIT

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.6.3

3 years ago

1.6.2

3 years ago

1.6.1

3 years ago

1.6.0

3 years ago

1.5.0

3 years ago

1.4.0

3 years ago

1.2.0

3 years ago

1.1.0

3 years ago