js_shims 1.0.0

js_shims #

Build Status

Common js utils to help porting node.js and javascript libs to dart. Behavior of libs should match the js implementation as closely as dart allows.

Installing via Pub #

Add this to your package's pubspec.yaml file:

dependencies:
  js_shims: ^1.0.0

1.0.0 #

  • Release first version

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  js_shims: ^1.0.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:js_shims/js_shims.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
30
Health:
Code health derived from static analysis. [more]
96
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
62
Learn more about scoring.

We analyzed this package on Jul 17, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.4.0
  • pana: 0.12.19

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:js_shims/js_shims.dart.

Health suggestions

Fix lib/src/strings.dart. (-2.96 points)

Analysis of lib/src/strings.dart reported 6 hints, including:

line 50 col 17: DO use curly braces for all flow control structures.

line 51 col 10: DO use curly braces for all flow control structures.

line 53 col 17: DO use curly braces for all flow control structures.

line 54 col 10: DO use curly braces for all flow control structures.

line 64 col 39: Don't explicitly initialize variables to null.

Fix lib/src/arrays.dart. (-1 points)

Analysis of lib/src/arrays.dart reported 2 hints:

line 86 col 7: DO use curly braces for all flow control structures.

line 88 col 7: DO use curly braces for all flow control structures.

Format lib/js_shims.dart.

Run dartfmt to format lib/js_shims.dart.

Fix additional 3 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/src/JSON.dart (Run dartfmt to format lib/src/JSON.dart.)
  • lib/src/console.dart (Run dartfmt to format lib/src/console.dart.)
  • lib/src/core.dart (Run dartfmt to format lib/src/core.dart.)

Maintenance suggestions

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and js_shims.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.67.0 <3.0.0
Dev dependencies
test ^1.0.0

Admin