How to use enketo-transformer - 2 common examples

To help you get started, we’ve selected a few enketo-transformer 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 enketo / enketo-core / Gruntfile.js View on Github external
.reduce( ( prevPromise, filePath ) => prevPromise.then( () => {
                const xformStr = grunt.file.read( filePath );
                grunt.log.writeln( `Transforming ${filePath}...` );
                return transformer.transform( { xform: xformStr } )
                    .then( result => {
                        forms[ filePath.substring( filePath.lastIndexOf( '/' ) + 1 ) ] = {
                            html_form: result.form,
                            xml_model: result.model
                        };
                    } );
            } ), Promise.resolve() )
            .then( () => {
github kobotoolbox / enketo-express / app / models / cache-model.js View on Github external
function _addHashes( survey ) {
    survey.formHash = survey.formHash || survey.info.hash;
    survey.xslHash = survey.xslHash || transformer.version;
}

enketo-transformer

Library that transforms ODK-compliant XForms into a format that Enketo can consume

Apache-2.0
Latest version published 12 days ago

Package Health Score

76 / 100
Full package analysis

Popular enketo-transformer functions