angel_mustache 2.0.0

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 59

mustache #

Gitter version build status

Mustache (Handlebars) view generator for the Angel web server framework.

Thanks so much @c4wrd for his help with bringing this project to life!

Installation #

In pubspec.yaml:

dependencies:
    angel_mustache: ^2.0.0

Usage #

const FileSystem fs = const LocalFileSystem();

configureServer(Angel app) async {
  // Run the plug-in
  await app.configure(mustache(fs.directory('views')));
  
  // Render `hello.mustache`
  await res.render('hello', {'name': 'world'});
}

Options #

  • partialsPath: A path within the viewsDirectory to search for partials in. Default is ./partials.
  • fileExtension: The file extension to search for. Default is .mustache.

2.0.0 #

  • Angel 2 and Dart 2 support.

example/main.dart

import 'package:angel_framework/angel_framework.dart';
import 'package:angel_mustache/angel_mustache.dart';
import 'package:file/file.dart';
import 'package:file/local.dart';

const FileSystem fs = const LocalFileSystem();

configureServer(Angel app) async {
  // Run the plug-in
  await app.configure(mustache(fs.directory('views')));

  // Render `hello.mustache`
  app.get('/', (req, res) async {
    await res.render('hello', {'name': 'world'});
  });
}

Use this package as a library

1. Depend on it

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


dependencies:
  angel_mustache: ^2.0.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:angel_mustache/angel_mustache.dart';
  
Version Uploaded Documentation Archive
2.0.0 Nov 8, 2018 Go to the documentation of angel_mustache 2.0.0 Download angel_mustache 2.0.0 archive
1.1.0 Nov 18, 2017 Go to the documentation of angel_mustache 1.1.0 Download angel_mustache 1.1.0 archive
1.0.3 Apr 5, 2017 Go to the documentation of angel_mustache 1.0.3 Download angel_mustache 1.0.3 archive
1.0.2 Jun 21, 2016 Go to the documentation of angel_mustache 1.0.2 Download angel_mustache 1.0.2 archive
1.0.1 May 2, 2016 Go to the documentation of angel_mustache 1.0.1 Download angel_mustache 1.0.1 archive
1.0.0 May 2, 2016 Go to the documentation of angel_mustache 1.0.0 Download angel_mustache 1.0.0 archive
1.0.0-dev Apr 22, 2016 Go to the documentation of angel_mustache 1.0.0-dev Download angel_mustache 1.0.0-dev archive
Popularity:
Describes how popular the package is relative to other packages. [more]
30
Health:
Code health derived from static analysis. [more]
95
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
59
Learn more about scoring.

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

  • Dart: 2.2.0
  • pana: 0.12.14

Platforms

Detected platforms: other

Primary library: package:angel_mustache/angel_mustache.dart with components: io, mirrors.

Health issues and suggestions

Document public APIs. (-1 points)

2 out of 2 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/src/cache.dart. (-2.48 points)

Analysis of lib/src/cache.dart reported 5 hints:

line 9 col 3: Prefer using /// for doc comments.

line 21 col 13: 'isProduction' is deprecated and shouldn't be used.

line 31 col 15: 'isProduction' is deprecated and shouldn't be used.

line 41 col 13: 'isProduction' is deprecated and shouldn't be used.

line 51 col 15: 'isProduction' is deprecated and shouldn't be used.

Fix lib/angel_mustache.dart. (-1 points)

Analysis of lib/angel_mustache.dart reported 2 hints:

line 11 col 26: Use = to separate a named parameter from its default value.

line 11 col 60: Use = to separate a named parameter from its default value.

Fix lib/src/mustache_context.dart. (-0.50 points)

Analysis of lib/src/mustache_context.dart reported 1 hint:

line 2 col 8: Unused import: 'package:path/path.dart'.

Maintenance suggestions

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev <3.0.0
angel_framework ^2.0.0-alpha 2.0.0-rc.8
file ^5.0.0 5.0.7
mustache4dart ^3.0.0-dev 3.0.0-dev.1.0
path ^1.0.0 1.6.2
Transitive dependencies
analyzer 0.34.3 0.36.0
angel_container 1.0.4
angel_http_exception 1.1.0
angel_model 1.0.2
angel_route 3.0.6
args 1.5.1
async 2.2.0
build 1.1.0 1.1.3
build_config 0.3.2
build_daemon 0.2.3 0.5.0
build_resolvers 0.2.3 1.0.4
build_runner 1.2.3 1.3.3
build_runner_core 2.0.1 3.0.3
built_collection 4.2.0
built_value 6.4.0
charcode 1.1.2
code_buffer 1.0.1
code_builder 3.2.0
collection 1.14.11
combinator 1.1.0
convert 2.1.1
crypto 2.0.6
csslib 0.15.0
dart2_constant 1.0.2+dart2
dart_style 1.2.3 1.2.7
fixnum 0.10.9
front_end 0.1.9+1 0.1.15
glob 1.1.7
graphs 0.2.0
html 0.14.0+1
http2 1.0.0
http_multi_server 2.0.5
http_parser 3.1.3
http_server 0.9.8+1
intl 0.15.8
io 0.3.3
js 0.6.1+1
json_annotation 2.2.0
kernel 0.3.9+1 0.3.15
logging 0.11.3+2
matcher 0.12.5
merge_map 1.0.2
meta 1.1.7
mime 0.9.6+2
mock_request 1.0.5
package_config 1.0.5
package_resolver 1.0.10
pedantic 1.5.0
plugin 0.2.0+3
pool 1.4.0
pub_semver 1.4.2
pubspec_parse 0.1.4
quiver 2.0.3
quiver_hashcode 2.0.0
reflectable 2.0.10+1
shelf 0.7.5
shelf_web_socket 0.2.3
source_span 1.5.5
stack_trace 1.9.3
stream_channel 2.0.0
stream_transform 0.0.17
string_scanner 1.0.4
term_glyph 1.1.0
timing 0.1.1+1
tuple 1.0.2
typed_data 1.1.6
uuid 2.0.1
watcher 0.9.7+10
web_socket_channel 1.0.12
yaml 2.1.15
Dev dependencies
http any 0.12.0+2
test any