unminify
Version 2.0.0
مشروع صغير للتراجع عن العديد من الأشياء الرهيبة التي ستفعلها أدوات بناء JavaScript مع JavaScript. بالإضافة إلى التراجع عن معظم القمامة ، فإنه يعكس بعض التقنيات "التغلب" الشائعة بشكل مدهش ولكن بشكل مدهش المستخدمة في البرية.
قد يكون لك أن تجربته ، على سبيل المثال ، هذا الجزء العشوائي من JavaScript الذي وجدته.
npm install -g unminify
أو استخدمه دون التثبيت عبر npx (متوفر منذ npm 5.2.0)
npx unminify [...args]
unminify /path/to/file.js
--safety لتمكين/تعطيل التحولات بناءً على ضمانات السلامة المطلوبة للمستخدم. ارجع إلى وثائق مستويات السلامة لمزيد من التفاصيل. قد تكون قيمة --safety واحدة منuselesssafe (افتراضي)mostly-safeunsafewildly-unsafe--additional-transform صفرًا أو أكثر ، يتبع كل منها مسارًا إلى وحدة نمطية توفر تحويل AST ؛ تشير الوظيفة إلى أن التحول لم يتم تطبيقه عن طريق إعادة مدخلاته let { unminifySource } = require ( 'unminify' ) ;
let sourceText = '/* a minified/"obfuscated" JavaScript program */' ;
console . log ( unminify ( sourceText ) ) ;
// or, with options
console . log ( unminifySource ( sourceText , {
safety : unminify . safetyLevels . UNSAFE ,
additionalTransforms : [ function ( ast ) { /* ... */ } ] ,
} ) ) ; إذا كان لديك بالفعل شجرة تحول ، فيمكنك استخدام unminifyTree لتجنب التكلفة الكودغن والتكلفة.
let { parseScript } = require ( 'shift-parser' ) ;
let { unminifyTree } = require ( 'unminify' ) ;
let sourceText = '/* a minified/"obfuscated" JavaScript program */' ;
let tree = parseScript ( sourceText ) ;
let unminifiedTree = unminifyTree ( tree ) ; Copyright 2017 Shape Security, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.