How to use rjsmin - 7 common examples

To help you get started, we’ve selected a few rjsmin examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github daleobrien / maze / maze / renderers / View on Github external
for j, row in enumerate(grid):
        js_row = []
        for i, cell in enumerate(row):

    grid = f"const grid = [{','.join(rows)}]"

    folder, _ = os.path.split(os.path.realpath(__file__))
    svg_template = open(os.path.join(folder, 'js/render.mako.js')).read()

    js_content = Template(svg_template).render(a=a, a2=a2, b=b, b2=b2, g=g, n=n, r=r, s=s, q=q, v=v, delta=delta,
                                               theta=theta, grid=grid, s2=s/2.0, r2=b-a, r3=(s/2.0-a/2.0), r4=r4,
                                               width=options['width'], height=height, s_x_s=s_x_s, s_y_s=s_y_s)

    js_content = rjsmin.jsmin(js_content)

    return js_content
github Kitware / VTK / Web / JavaScript / Minimizer / View on Github external
# write output to file
dir = os.path.dirname(args.m)
if not os.path.exists(dir):
with open(args.m,"w") as fp:

# write minimized output to file
dir = os.path.dirname(args.o)
if not os.path.exists(dir):
with open(args.o,"w") as fp:
github binaryage / dirac / scripts / View on Github external
import_file = open(full_path, 'r')
        import_script =
        return import_script

    output_script = re.sub(r'importScripts?\([\'"]([^\'"]+)[\'"]\)', replace, input_script)
    if"importScripts?\(\"", output_script):
        raise Exception('Unresolved "importScript" statements found in "%s". '
                        'Make sure you call "importScript" in module heads only.' %

    if os.path.exists(output_file_name):
    output_file = open(output_file_name, 'w')
    if not no_minify:
        output_script = rjsmin.jsmin(output_script)

    # Touch output file directory to make sure that Xcode will copy
    # modified resource files.
    if sys.platform == 'darwin':
        output_dir_name = os.path.dirname(output_file_name)
        os.utime(output_dir_name, None)
github limodou / uliweb / uliweb / View on Github external
def process_file(self, sfile, dpath, dfile):
        from rjsmin.rjsmin import jsmin
        from rcssmin.rcssmin import cssmin

        js_compressor = None
        css_compressor = None

        if sfile.endswith('.js') and ('.min.' not in sfile and '.pack.' not in sfile) and (self.options.js or
            open(dfile, 'w').write(jsmin(open(sfile).read()))
            if self.global_options.verbose:
                print 'Compress %s to %s' % (sfile, dfile)
            return True
        if sfile.endswith('.css') and ('.min.' not in sfile and '.pack.' not in sfile) and (self.options.css or
            open(dfile, 'w').write(cssmin(open(sfile).read()))
            if self.global_options.verbose:
                print 'Compress %s to %s' % (sfile, dfile)
            return True


Javascript Minifier

Latest version published 9 months ago

Package Health Score

66 / 100
Full package analysis

Popular rjsmin functions

Similar packages